Skip to content

Commit

Permalink
Merge pull request #743 from LoboEire/master
Browse files Browse the repository at this point in the history
New Actions: GRAVITY and NO_GRAVITY
  • Loading branch information
dashodanger authored Nov 4, 2024
2 parents 40290d4 + fd8b325 commit 2903498
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
7 changes: 4 additions & 3 deletions edge_base/heretic/scripts/things.ddf
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ PAINCHANCE=90%;
CASTORDER=7;
BLOOD=BLOOD;
FLOAT_SPEED=5;
SPECIAL=COUNT_AS_KILL,SOLID,SPAWNCEILING,CLIMBABLE,SHOOTABLE,NOGRAVITY,FLOATER;
SPECIAL=COUNT_AS_KILL,SOLID,SPAWNCEILING,CLIMBABLE,SHOOTABLE,NOGRAVITY,FLOATER,NOGRAV_KILL;
MINATTACK_CHANCE=22%;
CASTORDER=7;
BLOOD=BLOOD;
Expand Down Expand Up @@ -1537,11 +1537,12 @@ STATES(DEATH)=IMPX:G:0:NORMAL:KILLSOUND,
IMPX:G:4:NORMAL:MAKEDEATHSOUND,
IMPX:H:3:NORMAL:SPARE_ATTACK,
IMPX:H:1:NORMAL:SPARE_ATTACK,
IMPX:H:0:NORMAL:JUMP(DEATH:6,50%),
IMPX:H:0:NORMAL:JUMP(DEATH:7,50%),
IMPX:H:1:NORMAL:SPARE_ATTACK,
IMPX:H:7:NORMAL:GRAVITY,
IMPX:I:7:NORMAL:NOTHING,
IMPX:J:7:NORMAL:MAKEDEAD,
IMPX:K:7:NORMAL:NOTHING,
IMPX:K:7:NORMAL:NOTHING,
IMPX:L:-1:NORMAL:NOTHING;

STATES(OVERKILL)=IMPX:S:5:NORMAL:NOTHING,
Expand Down
3 changes: 3 additions & 0 deletions source_files/ddf/ddf_thing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ const DDFActionCode thing_actions[] = {{"NOTHING", nullptr, nullptr},
{"CLEAR_INVULNERABLE", A_ClearInvuln, nullptr},
{"SET_PAINCHANCE", A_PainChanceSet, DDFStateGetPercent},

{"GRAVITY", A_Gravity, nullptr},
{"NO_GRAVITY", A_NoGravity, nullptr},

{"CLEAR_TARGET", A_ClearTarget, nullptr},
{"FRIEND_LOOKOUT", A_FriendLook, nullptr},

Expand Down
4 changes: 4 additions & 0 deletions source_files/ddf/ddf_weapon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ static const DDFActionCode weapon_actions[] = {{"NOTHING", nullptr, nullptr},
{"ZOOM", A_WeaponZoom, nullptr},
{"SET_INVULNERABLE", A_SetInvuln, nullptr},
{"CLEAR_INVULNERABLE", A_ClearInvuln, nullptr},

{"GRAVITY", A_Gravity, nullptr},
{"NO_GRAVITY", A_NoGravity, nullptr},

{"MOVE_FWD", WA_MoveFwd, DDFStateGetFloat},
{"MOVE_RIGHT", WA_MoveRight, DDFStateGetFloat},
{"MOVE_UP", WA_MoveUp, DDFStateGetFloat},
Expand Down
9 changes: 9 additions & 0 deletions source_files/edge/p_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5088,6 +5088,15 @@ void A_PainChanceSet(MapObject *mo)
mo->pain_chance_ = value;
}

void A_Gravity(MapObject *mo)
{
mo->flags_ &= ~kMapObjectFlagNoGravity; //Remove NoGravity flag
}

void A_NoGravity(MapObject *mo)
{
mo->flags_ |= kMapObjectFlagNoGravity; //Set NoGravity flag
}

// Thing will forget both current target and supported player
void A_ClearTarget(MapObject *object)
Expand Down
3 changes: 3 additions & 0 deletions source_files/edge/p_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ void A_ClearInvuln(MapObject *mo);

void A_PainChanceSet(MapObject *mo);

void A_Gravity(MapObject *mo);
void A_NoGravity(MapObject *mo);

void A_ClearTarget(MapObject *mo);
void A_FriendLook(MapObject *mo);
bool FindPlayerToSupport(MapObject *mo);
Expand Down

0 comments on commit 2903498

Please sign in to comment.