Skip to content

Commit

Permalink
enchantment: REGEN_MANA
Browse files Browse the repository at this point in the history
  • Loading branch information
KorGgenT committed Sep 22, 2019
1 parent 3e67db5 commit b45659e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/mods/Magiclysm/itemgroups/itemgroups.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{
"type": "item_group",
"id": "displays",
"items": [ [ "mana_potion_lesser", 50 ], [ "magi_staff_minor", 5 ] ]
"items": [ [ "mana_potion_lesser", 50 ], [ "magi_staff_minor", 5 ], [ "wizard_hat", 5 ] ]
},
{
"id": "coffee_display_2",
Expand Down
22 changes: 22 additions & 0 deletions data/mods/Magiclysm/items/enchanted.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,27 @@
"bashing": 19,
"category": "weapons",
"to_hit": 3
},
{
"id": "wizard_hat",
"type": "ARMOR",
"name": "wizard hat",
"description": "A blue pointed hat with stars stiched into it. Wearing it increases your mana regeneration.",
"weight": "390 g",
"volume": "2 L",
"price": 9500,
"material": [ "cotton" ],
"symbol": "^",
"color": "light_blue",
"covers": [ "HEAD" ],
"coverage": 50,
"encumbrance": 12,
"warmth": 7,
"material_thickness": 2,
"environmental_protection": 2,
"relic_data": {
"passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "REGEN_MANA", "multiply": 1 } ] } ]
},
"flags": [ "VARSIZE" ]
}
]
3 changes: 2 additions & 1 deletion src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,8 @@ void known_magic::update_mana( const player &p, float turns )
// mana should replenish in 8 hours.
const float full_replenish = to_turns<float>( 8_hours );
const float ratio = turns / full_replenish;
mod_mana( p, floor( ratio * max_mana( p ) * p.mutation_value( "mana_regen_multiplier" ) ) );
mod_mana( p, floor( ratio * p.calculate_by_enchantment( max_mana( p ) *
p.mutation_value( "mana_regen_multiplier" ), enchantment::mod::REGEN_MANA ) ) );
}

std::vector<spell_id> known_magic::spells() const
Expand Down

0 comments on commit b45659e

Please sign in to comment.