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

@@ -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)