Skip to content

Commit

Permalink
[MoM] Separate psi_stunned from stunned (CleverRaven#69813)
Browse files Browse the repository at this point in the history
* Initial commit

* Update src/mattack_actors.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/monster.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/monster.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix typo

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Standing-Storm and github-actions[bot] authored Nov 29, 2023
1 parent 97f18d7 commit d12347d
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 15 deletions.
13 changes: 13 additions & 0 deletions data/mods/MindOverMatter/effects/effects_penalty.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@
"int_decay_remove": true,
"flags": [ "NO_PSIONICS" ]
},
{
"type": "effect_type",
"id": "psi_stunned",
"//": "Separate ID to allow telepaths and telepathy-immune monsters to defend against it.",
"name": [ "Stunned" ],
"desc": [ "Your mind is reeling." ],
"apply_message": "You're stunned!",
"rating": "bad",
"show_in_info": true,
"limb_score_mods": [ { "limb_score": "balance", "modifier": 0.2 }, { "limb_score": "reaction", "modifier": 0.0 } ],
"immune_flags": [ "TEEPSHIELD", "TEEP_IMMUNE" ],
"flags": [ "DISABLE_FLIGHT", "EFFECT_LIMB_SCORE_MOD", "NO_SPELLCASTING", "NO_PSIONICS" ]
},
{
"type": "effect_type",
"id": "effect_psi_neutralized",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/MindOverMatter/effects/effects_psionic.json
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@
"max_intensity": 17,
"dur_add_perc": 10,
"int_dur_factor": "35 s",
"removes_effects": [ "taint", "tindrift", "hallu", "hallucination_attacks", "visuals", "fearparalyze", "amigara" ],
"removes_effects": [ "taint", "tindrift", "hallu", "hallucination_attacks", "visuals", "fearparalyze", "amigara", "psi_stunned" ],
"flags": [ "PORTAL_PROOF", "TEEPSHIELD" ]
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/mods/MindOverMatter/monsters/monsters_spells.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@
"difficulty": 1,
"max_level": 20,
"effect": "attack",
"effect_str": "stunned",
"effect_str": "psi_stunned",
"extra_effects": [
{ "id": "telepathic_deprivation_monster", "hit_self": false, "max_level": 3 },
{ "id": "telepathic_deafening_monster", "hit_self": false, "max_level": 3 }
Expand Down
7 changes: 3 additions & 4 deletions data/mods/MindOverMatter/powers/telepathy.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,17 @@
"difficulty": 5,
"max_level": { "math": [ "int_to_level(1)" ] },
"effect": "attack",
"effect_str": "stunned",
"damage_type": "psi_telepathic_damage",
"effect_str": "psi_stunned",
"extra_effects": [
{ "id": "telepathic_confusion_blind", "hit_self": false, "max_level": 20 },
{ "id": "psionic_drained_difficulty_five", "hit_self": true }
],
"shape": "blast",
"min_duration": {
"math": [ "( (u_val('spell_level', 'spell: telepathic_confusion') * 100) + 400) * (scaling_factor(u_val('intelligence') ) )" ]
"math": [ "( (u_val('spell_level', 'spell: telepathic_confusion') * 50) + 200) * (scaling_factor(u_val('intelligence') ) )" ]
},
"max_duration": {
"math": [ "( (u_val('spell_level', 'spell: telepathic_confusion') * 100) + 2000) * (scaling_factor(u_val('intelligence') ) )" ]
"math": [ "( (u_val('spell_level', 'spell: telepathic_confusion') * 100) + 800) * (scaling_factor(u_val('intelligence') ) )" ]
},
"min_range": {
"math": [
Expand Down
4 changes: 4 additions & 0 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static const efftype_id effect_happy( "happy" );
static const efftype_id effect_irradiated( "irradiated" );
static const efftype_id effect_onfire( "onfire" );
static const efftype_id effect_pkill( "pkill" );
static const efftype_id effect_psi_stunned( "psi_stunned" );
static const efftype_id effect_relax_gas( "relax_gas" );
static const efftype_id effect_sad( "sad" );
static const efftype_id effect_sleep( "sleep" );
Expand Down Expand Up @@ -883,6 +884,9 @@ nc_color avatar::basic_symbol_color() const
if( has_effect( effect_stunned ) ) {
return c_light_blue;
}
if( has_effect( effect_psi_stunned ) ) {
return c_light_blue;
}
if( has_effect( effect_boomered ) ) {
return c_pink;
}
Expand Down
7 changes: 4 additions & 3 deletions src/avatar_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ static const efftype_id effect_hunger_engorged( "hunger_engorged" );
static const efftype_id effect_incorporeal( "incorporeal" );
static const efftype_id effect_onfire( "onfire" );
static const efftype_id effect_pet( "pet" );
static const efftype_id effect_psi_stunned( "psi_stunned" );
static const efftype_id effect_ridden( "ridden" );
static const efftype_id effect_stunned( "stunned" );
static const efftype_id effect_winded( "winded" );
Expand All @@ -88,7 +89,7 @@ static const trait_id trait_SHELL3( "SHELL3" );

static bool check_water_affect_items( avatar &you )
{
if( you.has_effect( effect_stunned ) ) {
if( you.has_effect( effect_stunned ) || you.has_effect( effect_psi_stunned ) ) {
return true;
}

Expand Down Expand Up @@ -177,7 +178,7 @@ bool avatar_action::move( avatar &you, map &m, const tripoint &d )

const bool is_riding = you.is_mounted();
tripoint dest_loc;
if( d.z == 0 && you.has_effect( effect_stunned ) ) {
if( d.z == 0 && ( you.has_effect( effect_stunned ) || you.has_effect( effect_psi_stunned ) ) ) {
dest_loc.x = rng( you.posx() - 1, you.posx() + 1 );
dest_loc.y = rng( you.posy() - 1, you.posy() + 1 );
dest_loc.z = you.posz();
Expand All @@ -204,7 +205,7 @@ bool avatar_action::move( avatar &you, map &m, const tripoint &d )
if( m.has_flag( ter_furn_flag::TFLAG_MINEABLE, dest_loc ) && g->mostseen == 0 &&
get_option<bool>( "AUTO_FEATURES" ) && get_option<bool>( "AUTO_MINING" ) &&
!m.veh_at( dest_loc ) && !you.is_underwater() && !you.has_effect( effect_stunned ) &&
!is_riding && !you.has_effect( effect_incorporeal ) ) {
!you.has_effect( effect_psi_stunned ) && !is_riding && !you.has_effect( effect_incorporeal ) ) {
if( weapon && weapon->has_flag( flag_DIG_TOOL ) ) {
if( weapon->type->can_use( "JACKHAMMER" ) &&
weapon->ammo_sufficient( &you ) ) {
Expand Down
3 changes: 2 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ static const efftype_id effect_led_by_leash( "led_by_leash" );
static const efftype_id effect_no_sight( "no_sight" );
static const efftype_id effect_onfire( "onfire" );
static const efftype_id effect_pet( "pet" );
static const efftype_id effect_psi_stunned( "psi_stunned" );
static const efftype_id effect_ridden( "ridden" );
static const efftype_id effect_riding( "riding" );
static const efftype_id effect_stunned( "stunned" );
Expand Down Expand Up @@ -10185,7 +10186,7 @@ bool game::is_dangerous_tile( const tripoint &dest_loc ) const

bool game::prompt_dangerous_tile( const tripoint &dest_loc ) const
{
if( u.has_effect( effect_stunned ) ) {
if( u.has_effect( effect_stunned ) || u.has_effect( effect_psi_stunned ) ) {
return true;
}

Expand Down
4 changes: 3 additions & 1 deletion src/mattack_actors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static const efftype_id effect_infected( "infected" );
static const efftype_id effect_laserlocked( "laserlocked" );
static const efftype_id effect_null( "null" );
static const efftype_id effect_poison( "poison" );
static const efftype_id effect_psi_stunned( "psi_stunned" );
static const efftype_id effect_run( "run" );
static const efftype_id effect_sensor_stun( "sensor_stun" );
static const efftype_id effect_stunned( "stunned" );
Expand Down Expand Up @@ -1236,7 +1237,8 @@ void gun_actor::shoot( monster &z, const tripoint &target, const gun_mode_id &mo
}
}

if( z.has_effect( effect_stunned ) || z.has_effect( effect_sensor_stun ) ) {
if( z.has_effect( effect_stunned ) || z.has_effect( effect_psi_stunned ) ||
z.has_effect( effect_sensor_stun ) ) {
return;
}

Expand Down
3 changes: 2 additions & 1 deletion src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ static const efftype_id effect_led_by_leash( "led_by_leash" );
static const efftype_id effect_no_sight( "no_sight" );
static const efftype_id effect_operating( "operating" );
static const efftype_id effect_pacified( "pacified" );
static const efftype_id effect_psi_stunned( "psi_stunned" );
static const efftype_id effect_pushed( "pushed" );
static const efftype_id effect_stumbled_into_invisible( "stumbled_into_invisible" );
static const efftype_id effect_stunned( "stunned" );
Expand Down Expand Up @@ -1033,7 +1034,7 @@ void monster::move()
moves = 0;
return;
}
if( has_effect( effect_stunned ) ) {
if( has_effect( effect_stunned ) || has_effect( effect_psi_stunned ) ) {
stumble();
moves = 0;
return;
Expand Down
7 changes: 5 additions & 2 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ static const efftype_id effect_paralyzepoison( "paralyzepoison" );
static const efftype_id effect_pet( "pet" );
static const efftype_id effect_photophobia( "photophobia" );
static const efftype_id effect_poison( "poison" );
static const efftype_id effect_psi_stunned( "psi_stunned" );
static const efftype_id effect_ridden( "ridden" );
static const efftype_id effect_run( "run" );
static const efftype_id effect_spooked( "spooked" );
Expand Down Expand Up @@ -1178,7 +1179,8 @@ bool monster::is_symbol_highlighted() const
nc_color monster::color_with_effects() const
{
nc_color ret = type->color;
if( has_effect( effect_beartrap ) || has_effect( effect_stunned ) || has_effect( effect_downed ) ||
if( has_effect( effect_beartrap ) || has_effect( effect_stunned ) ||
has_effect( effect_psi_stunned ) || has_effect( effect_downed ) ||
has_effect( effect_tied ) ||
has_effect( effect_lightsnare ) || has_effect( effect_heavysnare ) ) {
ret = hilite( ret );
Expand Down Expand Up @@ -1287,7 +1289,8 @@ bool monster::can_act() const
{
return moves > 0 &&
( effects->empty() ||
( !has_effect( effect_stunned ) && !has_effect( effect_downed ) && !has_effect( effect_webbed ) ) );
( !has_effect( effect_stunned ) && !has_effect( effect_psi_stunned ) &&
!has_effect( effect_downed ) && !has_effect( effect_webbed ) ) );
}

int monster::sight_range( const float light_level ) const
Expand Down
3 changes: 2 additions & 1 deletion src/npcmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ static const efftype_id effect_npc_flee_player( "npc_flee_player" );
static const efftype_id effect_npc_player_still_looking( "npc_player_still_looking" );
static const efftype_id effect_npc_run_away( "npc_run_away" );
static const efftype_id effect_onfire( "onfire" );
static const efftype_id effect_psi_stunned( "psi_stunned" );
static const efftype_id effect_stumbled_into_invisible( "stumbled_into_invisible" );
static const efftype_id effect_stunned( "stunned" );

Expand Down Expand Up @@ -2828,7 +2829,7 @@ void npc::move_to( const tripoint &pt, bool no_bashing, std::set<tripoint> *nomo

recoil = MAX_RECOIL;

if( has_effect( effect_stunned ) ) {
if( has_effect( effect_stunned ) || has_effect( effect_psi_stunned ) ) {
p.x = rng( posx() - 1, posx() + 1 );
p.y = rng( posy() - 1, posy() + 1 );
p.z = posz();
Expand Down

0 comments on commit d12347d

Please sign in to comment.