Skip to content

Commit

Permalink
added lashit support for DOL and a
Browse files Browse the repository at this point in the history
read only entityprop "die_on_landing" to know if the entity is dying for DOL
  • Loading branch information
White Dragon committed Feb 5, 2018
1 parent 3b5ff91 commit 216bfb5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
52 changes: 31 additions & 21 deletions engine/openbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -23637,6 +23637,7 @@ void checkdamageonlanding()
if( (self->damage_on_landing[0] > 0 && !self->dead) )
{
int atk_force = 0;
int didhit = 0;

//##################
s_collision_attack attack;
Expand All @@ -23653,6 +23654,12 @@ void checkdamageonlanding()
execute_ondoattack_script(self, other, attack.attack_force, attack.attack_drop, attack.attack_type, attack.no_block, attack.guardcost, attack.jugglecost, attack.pause_add, 0, other->attack_id, attack.tag); //Execute on defender.
execute_ondoattack_script(other, self, attack.attack_force, attack.attack_drop, attack.attack_type, attack.no_block, attack.guardcost, attack.jugglecost, attack.pause_add, 1, other->attack_id, attack.tag); //Execute on attacker.

checkhit(other, self);
if(lasthit.confirm)
{
didhit = 1;
}

if(self->dead)
{
return;
Expand All @@ -23673,32 +23680,35 @@ void checkdamageonlanding()
}
//##################

atk_force = calculate_force_damage(other, &attack);

if (self->health - atk_force > 0)
if (didhit)
{
// pre-check drop
checkdamagedrop(&attack);
// Drop Weapon due to being hit.
if(self->modeldata.weaploss[0] == WEAPLOSS_TYPE_ANY)
{
dropweapon(1);
}
// check effects, e.g., frozen, blast, steal
if(!(self->modeldata.guardpoints.max > 0 && self->modeldata.guardpoints.current <= 0))
atk_force = calculate_force_damage(other, &attack);

if (self->health - atk_force > 0)
{
checkdamageeffects(&attack);
// pre-check drop
checkdamagedrop(&attack);
// Drop Weapon due to being hit.
if(self->modeldata.weaploss[0] == WEAPLOSS_TYPE_ANY)
{
dropweapon(1);
}
// check effects, e.g., frozen, blast, steal
if(!(self->modeldata.guardpoints.max > 0 && self->modeldata.guardpoints.current <= 0))
{
checkdamageeffects(&attack);
}

// mprate can also control the MP recovered per hit.
checkmpadd();
//damage score
checkhitscore(other, &attack);
}
//self->health -= atk_force;
checkdamage(other, &attack);

// mprate can also control the MP recovered per hit.
checkmpadd();
//damage score
checkhitscore(other, &attack);
execute_didhit_script(other, self, attack.attack_force, attack.attack_drop, other->modeldata.subtype, attack.no_block, attack.guardcost, attack.jugglecost, attack.pause_add, 0, attack.tag);
}
//self->health -= atk_force;
checkdamage(other, &attack);

execute_didhit_script(other, self, attack.attack_force, attack.attack_drop, other->modeldata.subtype, attack.no_block, attack.guardcost, attack.jugglecost, attack.pause_add, 0, attack.tag);

if (self->health <= 0)
{
Expand Down
12 changes: 10 additions & 2 deletions engine/openborscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -1972,7 +1972,8 @@ enum entityproperty_enum
_ep_defense,
_ep_destx,
_ep_destz,
_ep_detect,
_ep_detect,
_ep_die_on_landing,
_ep_direction,
_ep_dot,
_ep_dropframe,
Expand Down Expand Up @@ -2168,7 +2169,8 @@ static const char *eplist[] =
"defense",
"destx",
"destz",
"detect",
"detect",
"die_on_landing",
"direction",
"dot",
"dropframe",
Expand Down Expand Up @@ -3705,6 +3707,12 @@ HRESULT openbor_getentityproperty(ScriptVariant **varlist , ScriptVariant **pret
ScriptVariant_ChangeType(*pretvar, VT_INTEGER);
(*pretvar)->lVal = (LONG)ent->modeldata.stealth.detect;
break;
}
case _ep_die_on_landing:
{
ScriptVariant_ChangeType(*pretvar, VT_INTEGER);
(*pretvar)->lVal = (LONG)ent->die_on_landing;
break;
}
case _ep_direction:
{
Expand Down

0 comments on commit 216bfb5

Please sign in to comment.