Code:
var a,b;
//New way to check damage :D
if other.id=gamer.id then
{
//If other is gamer
if global.ish=1 then {a=0}
else if global.ish=0 then {a=round((damage*damage_x)-irandom((damage*damage_x)*0.2))}
}
else if other.id!=gamer.id then
{
//If other is not gamer
if other.ish=1 then {a=0}
else if other.ish=0 then {a=round((damage*damage_x)-irandom((damage*damage_x)*0.2))}
}
b=a-other.own_shield
if b < 0 then b=0
if other.id=owner.target then {
if gamer.ammo[0,0]=5 and owner.object_index=gamer then
{
if other.own_shield > 0
{
other.own_shield-=a*1.0;}
}
else
if other.own_shield<=0 then {other.own_health-=a;}
else {
other.own_shield-=a*0.9; other.own_health-=((a*0.1)+b);}
ELDMG=round(a*0.05)
if global.eleech=1 and gamer.ammo[0,0]!=5 and owner.object_index=gamer then
{owner.own_health+=ELDMG
if owner.object_index=gamer and damage>0 draw_damage(gamer.x,gamer.y,'+' + string(ELDMG),c_lime);
}
if other.own_shield > a and gamer.ammo[0,0]=5 and owner.object_index=gamer then
if owner.own_shield_bilo < owner.shield_def then
{
//if owner.object_index=gamer and a>0 draw_damage(gamer.x,gamer.y,'+' + string(a),c_aqua);
gamer.own_shield+=round(a)
}
else
{
//if owner.object_index=gamer and a>0 draw_damage(gamer.x,gamer.y,'+' + '0',c_aqua);
}
if a=0 then a='MISS'
if owner.object_index=gamer and damage>0 then draw_damage(other.x,other.y-80,a,c_red);}
collision with ships:
Code:
var a;
//New way to check damage :D
if other.id=gamer.id then
{
//If other is gamer
if global.ish=1 then {a=0}
else if global.ish=0 then {a=round((damage*damage_x)-irandom((damage*damage_x)*0.2))}
}
else if other.id!=gamer.id then
{
//If other is not gamer
if other.ish=1 then {a=0}
else if other.ish=0 then {a=round((damage*damage_x)-irandom((damage*damage_x)*0.2))}
}
b=a-other.own_shield
if b < 0 then b=0
if other.id=owner.target then {
if gamer.ammo[0,0]=5 and owner.object_index=gamer then
{
if other.own_shield > 0
{
other.own_shield-=a*1.0;}
}
else
if other.own_shield<=0 then {other.own_health-=a;}
else {
other.own_shield-=a*0.92; other.own_health-=((a*0.08)+b);}
ELDMG=round(a*0.05)
if global.eleech=1 and gamer.ammo[0,0]!=5 and owner.object_index=gamer then
{owner.own_health+=ELDMG
if owner.object_index=gamer and damage>0 draw_damage(gamer.x,gamer.y,'+' + string(ELDMG),c_lime);
}
if other.own_shield > a and gamer.ammo[0,0]=5 and owner.object_index=gamer then
if owner.own_shield_bilo < owner.shield_def then
{
//if owner.object_index=gamer and a>0 draw_damage(gamer.x,gamer.y,'+' + string(a),c_aqua);
gamer.own_shield+=round(a)
}
else
{
//if owner.object_index=gamer and a>0 draw_damage(gamer.x,gamer.y,'+' + '0',c_aqua);
}
if a=0 then a='MISS'
if owner.object_index=gamer and damage>0 then draw_damage(other.x,other.y-80,a,c_red);}