Add new recharge spell (only an item spell currently)

This commit is contained in:
2024-08-29 21:05:55 -04:00
committed by Celtic Minstrel
parent 54d769a4d1
commit da21e7d775
6 changed files with 26 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ Aura of Flames
Summon Aid
Major Summon Aid
Flash Step
Recharge

View File

@@ -2234,6 +2234,8 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
else if(overall_mode == MODE_ITEM_TARGET) {
if(stat_screen_mode == MODE_IDENTIFY)
ASB("Identify: Finished");
else if(stat_screen_mode == MODE_RECHARGE)
ASB("Recharge: Finished");
overall_mode = MODE_TOWN;
stat_screen_mode = MODE_INVEN;
} else if(overall_mode == MODE_TOWN || overall_mode == MODE_COMBAT || overall_mode == MODE_OUTDOORS) {

View File

@@ -600,6 +600,25 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) {
for(cItem& item : pc.items)
item.ident = true;
break;
case eSpell::RECHARGE:
if(!freebie)
univ.party[pc_num].cur_sp -= (*spell_num).cost;
if(is_town()) {
ASB("Select items to recharge. Press Space when done.");
overall_mode = MODE_ITEM_TARGET;
stat_screen_mode = MODE_RECHARGE;
extern short shop_identify_cost;
shop_identify_cost = 0;
put_item_screen(stat_window);
break;
}
ASB("All of your items are recharged.");
for(cPlayer& pc : univ.party)
for(cItem& item : pc.items)
if(item.rechargeable && item.charges == 0)
item.charges = item.max_charges;
break;
case eSpell::TRUE_SIGHT:
if(!freebie)

View File

@@ -1902,7 +1902,7 @@ static bool edit_item_abil_event_filter(cDialog& me, std::string hit, cItem& ite
i = choose_text(STRT_SKILL, i, &me, "Boost which skill?");
break;
case eItemAbil::CAST_SPELL:
i = choose_text_res("magic-names", 1, 78, i + 1, &me, "Which mage spell?");
i = choose_text_res("magic-names", 1, 79, i + 1, &me, "Which mage spell?");
if(i < 0) return true;
break;
case eItemAbil::SUMMONING:

View File

@@ -404,6 +404,8 @@ cSpell S_SUMMON_AID_MAJOR = cSpell(eSpell::SUMMON_AID_MAJOR)
.withRange(4).withRefer(REFER_TARGET).when(WHEN_COMBAT).when(WHEN_TOWN).finish();
cSpell S_FLASH_STEP = cSpell(eSpell::FLASH_STEP)
.withRange(8).withRefer(REFER_TARGET).when(WHEN_COMBAT).asPeaceful().finish();
cSpell M_RECHARGE = cSpell(eSpell::RECHARGE).asType(eSkill::MAGE_SPELLS).asLevel(7)
.withCost(50).when(WHEN_TOWN).when(WHEN_OUTDOORS).asPeaceful().finish();
cSpell S_AUGMENTATION = cSpell(eSpell::AUGMENTATION)
.withRange(10).withRefer(REFER_IMMED).needsSelect().when(WHEN_COMBAT).finish();
cSpell S_NIRVANA = cSpell(eSpell::NIRVANA)

View File

@@ -40,7 +40,7 @@ enum class eSpell {
QUICKFIRE = 60, ARROWS_DEATH = 61, /* Special spells */ STRENGTHEN_TARGET = 62, SUMMON_RAT = 63, WALL_ICE_BALL = 64,
GOO_BOMB = 65, FOUL_VAPOR = 66, CLOUD_SLEEP_LARGE = 67, ACID_SPRAY = 68, PARALYZE_BEAM = 69,
SLEEP_MASS = 70, RAVAGE_ENEMIES = 71, BLADE_AURA = 72, ICY_RAIN = 73, FLAME_AURA = 74,
SUMMON_AID = 75, SUMMON_AID_MAJOR = 76, FLASH_STEP = 77,
SUMMON_AID = 75, SUMMON_AID_MAJOR = 76, FLASH_STEP = 77, RECHARGE = 78,
// Priest spells
BLESS_MINOR = 100, HEAL_MINOR = 101, POISON_WEAKEN = 102, TURN_UNDEAD = 103, LOCATION = 104,
SANCTUARY = 105, SYMBIOSIS = 106, MANNA_MINOR = 107, RITUAL_SANCTIFY = 108, STUMBLE = 109,