Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Actions: GRAVITY and NO_GRAVITY #743

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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