Skip to content

Commit

Permalink
Merge pull request #47852 from Fris0uman/sleep_now
Browse files Browse the repository at this point in the history
Remove unused FATIGUE energy source from spells
  • Loading branch information
ZhilkinSerg authored Mar 3, 2021
2 parents ecf290c + ba346e2 commit 5b466f4
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 32 deletions.
15 changes: 0 additions & 15 deletions data/mods/Magiclysm/Spells/debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,6 @@
"base_energy_cost": 100,
"energy_source": "STAMINA"
},
{
"id": "debug_fatigue",
"type": "SPELL",
"name": "Debug Fatigue Spell",
"description": "Uses a little fatigue",
"message": "Debug spell %s cast.",
"valid_targets": [ "self" ],
"effect": "none",
"shape": "blast",
"min_range": 1,
"max_range": 1,
"base_casting_time": 100,
"base_energy_cost": 100,
"energy_source": "FATIGUE"
},
{
"id": "debug_polymorph",
"type": "SPELL",
Expand Down
2 changes: 1 addition & 1 deletion doc/MAGIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In `data/mods/Magiclysm` there is a template spell, copied here for your perusal
"spell_class": "NONE", //
"base_casting_time": 100, // this is the casting time (in moves)
"base_energy_cost": 10, // the amount of energy (of the requisite type) to cast the spell
"energy_source": "MANA", // the type of energy used to cast the spell. types are: MANA, BIONIC, HP, STAMINA, FATIGUE, NONE (none will not use mana)
"energy_source": "MANA", // the type of energy used to cast the spell. types are: MANA, BIONIC, HP, STAMINA, NONE (none will not use mana)
"components": [requirement_id] // an id from a requirement, like the ones you use for crafting. spell components require to cast.
"difficulty": 12, // the difficulty to learn/cast the spell
"max_level": 10, // maximum level you can achieve in the spell
Expand Down
3 changes: 0 additions & 3 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4281,9 +4281,6 @@ void activity_handlers::spellcasting_finish( player_activity *act, player *p )
case magic_energy_type::hp:
blood_magic( p, cost );
break;
case magic_energy_type::fatigue:
p->mod_fatigue( cost );
break;
case magic_energy_type::none:
default:
break;
Expand Down
12 changes: 0 additions & 12 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ std::string enum_to_string<magic_energy_type>( magic_energy_type data )
{
switch( data ) {
case magic_energy_type::bionic: return "BIONIC";
case magic_energy_type::fatigue: return "FATIGUE";
case magic_energy_type::hp: return "HP";
case magic_energy_type::mana: return "MANA";
case magic_energy_type::none: return "NONE";
Expand Down Expand Up @@ -1047,8 +1046,6 @@ std::string spell::energy_string() const
return _( "stamina" );
case magic_energy_type::bionic:
return _( "bionic power" );
case magic_energy_type::fatigue:
return _( "fatigue" );
default:
return "";
}
Expand All @@ -1070,9 +1067,6 @@ std::string spell::energy_cost_string( const Character &guy ) const
auto pair = get_hp_bar( energy_cost( guy ), guy.get_stamina_max() );
return colorize( pair.first, pair.second );
}
if( energy_source() == magic_energy_type::fatigue ) {
return colorize( std::to_string( energy_cost( guy ) ), c_cyan );
}
debugmsg( "ERROR: Spell %s has invalid energy source.", id().c_str() );
return _( "error: energy_type" );
}
Expand All @@ -1095,10 +1089,6 @@ std::string spell::energy_cur_string( const Character &guy ) const
if( energy_source() == magic_energy_type::hp ) {
return "";
}
if( energy_source() == magic_energy_type::fatigue ) {
const std::pair<std::string, nc_color> pair = guy.get_fatigue_description();
return colorize( pair.first, pair.second );
}
debugmsg( "ERROR: Spell %s has invalid energy source.", id().c_str() );
return _( "error: energy_type" );
}
Expand Down Expand Up @@ -1729,8 +1719,6 @@ bool known_magic::has_enough_energy( const Character &guy, const spell &sp ) con
}
}
return false;
case magic_energy_type::fatigue:
return guy.get_fatigue() < fatigue_levels::EXHAUSTED;
case magic_energy_type::none:
return true;
default:
Expand Down
1 change: 0 additions & 1 deletion src/magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ enum class magic_energy_type : int {
mana,
stamina,
bionic,
fatigue,
none,
last
};
Expand Down

0 comments on commit 5b466f4

Please sign in to comment.