Skip to content

Commit

Permalink
Merge pull request #77917 from GuardianDll/obsolete_OM_MOVE
Browse files Browse the repository at this point in the history
Obsolete OM_MOVE
  • Loading branch information
Night-Pryanik authored Nov 17, 2024
2 parents 4db2d54 + b386906 commit cb9c19a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@
},
{
"type": "effect_on_condition",
"eoc_type": "OM_MOVE",
"eoc_type": "EVENT",
"required_event": "avatar_enters_omt",
"id": "EOC_HAVE_U_BEEN_TO_MIGOS",
"condition": {
"or": [
Expand Down
3 changes: 1 addition & 2 deletions doc/EFFECT_ON_CONDITION.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ An effect_on_condition is an object allowing the combination of dialog condition
| `false_effect` | effect | The effect(s) caused if `condition` returns false upon activation. See the "Dialogue Effects" section of [NPCs](NPCs.md) for the full syntax.
| `global` | bool | If this is true, this recurring eoc will be run on the player and every npc from a global queue. Deactivate conditions will work based on the avatar. If it is false the avatar and every character will have their own copy and their own deactivated list. Defaults to false.
| `run_for_npcs` | bool | Can only be true if global is true. If false the EOC will only be run against the avatar. If true the eoc will be run against the avatar and all npcs. Defaults to false.
| `EOC_TYPE` | string | Can be one of `ACTIVATION`, `RECURRING`, `SCENARIO_SPECIFIC`, `AVATAR_DEATH`, `NPC_DEATH`, `OM_MOVE`, `PREVENT_DEATH`, `EVENT` (see details below). It defaults to `ACTIVATION` unless `recurrence` is provided in which case it defaults to `RECURRING`.
| `EOC_TYPE` | string | Can be one of `ACTIVATION`, `RECURRING`, `SCENARIO_SPECIFIC`, `AVATAR_DEATH`, `NPC_DEATH`, `PREVENT_DEATH`, `EVENT` (see details below). It defaults to `ACTIVATION` unless `recurrence` is provided in which case it defaults to `RECURRING`.

### EOC types

Expand All @@ -49,7 +49,6 @@ An effect_on_condition is an object allowing the combination of dialog condition
* `SCENARIO_SPECIFIC` - automatically invoked once on scenario start.
* `AVATAR_DEATH` - automatically invoked whenever the current avatar dies (it will be run with the avatar as `u`), if after it the player is no longer dead they will not die, if there are multiple EOCs they all be run until the player is not dead.
* `NPC_DEATH` - EOCs can only be assigned to run on the death of an npc, in which case u will be the dying npc and npc will be the killer. If after it npc is no longer dead they will not die, if there are multiple they all be run until npc is not dead.
* `OM_MOVE` - EOCs trigger when the player moves overmap tiles
* `PREVENT_DEATH` - whenever the current avatar dies it will be run with the avatar as `u`, if after it the player is no longer dead they will not die, if there are multiple they all be run until the player is not dead.
* `EVENT` - EOCs trigger when a specific event given by "required_event" takes place.

Expand Down
12 changes: 0 additions & 12 deletions src/effect_on_condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ namespace io
case eoc_type::SCENARIO_SPECIFIC: return "SCENARIO_SPECIFIC";
case eoc_type::AVATAR_DEATH: return "AVATAR_DEATH";
case eoc_type::NPC_DEATH: return "NPC_DEATH";
case eoc_type::OM_MOVE: return "OM_MOVE";
case eoc_type::PREVENT_DEATH: return "PREVENT_DEATH";
case eoc_type::EVENT: return "EVENT";
case eoc_type::NUM_EOC_TYPES: break;
Expand Down Expand Up @@ -467,17 +466,6 @@ void effect_on_conditions::avatar_death()
}
}

void effect_on_conditions::om_move()
{
avatar &player_character = get_avatar();
dialogue d( get_talker_for( player_character ), nullptr );
for( const effect_on_condition &eoc : effect_on_conditions::get_all() ) {
if( eoc.type == eoc_type::OM_MOVE ) {
eoc.activate( d );
}
}
}

void effect_on_condition::finalize()
{
}
Expand Down
3 changes: 0 additions & 3 deletions src/effect_on_condition.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ enum eoc_type {
SCENARIO_SPECIFIC,
AVATAR_DEATH,
NPC_DEATH,
OM_MOVE,
PREVENT_DEATH,
EVENT,
NUM_EOC_TYPES
Expand Down Expand Up @@ -114,8 +113,6 @@ void write_global_eocs_to_file();
void prevent_death();
/** Run all avatar death eocs */
void avatar_death();
/** Run all OM_MOVE eocs */
void om_move();
} // namespace effect_on_conditions

template<>
Expand Down
1 change: 0 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13950,7 +13950,6 @@ void avatar_moves( const tripoint &old_abs_pos, const avatar &u, const map &m )
const oter_id &past_ter = overmap_buffer.ter( old_abs_omt );
get_event_bus().send<event_type::avatar_enters_omt>( new_abs_omt.raw(), cur_ter );
// if the player has moved omt then might trigger an EOC for that OMT
effect_on_conditions::om_move();
if( !past_ter->get_exit_EOC().is_null() ) {
dialogue d( get_talker_for( get_avatar() ), nullptr );
effect_on_condition_id eoc = cur_ter->get_exit_EOC();
Expand Down

0 comments on commit cb9c19a

Please sign in to comment.