mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	* new spell: fire shield
This commit is contained in:
		| @@ -927,6 +927,9 @@ static std::vector<StackFeature> stackEffectToFeature(const CStack::StackEffect | ||||
| 	case 28: //air shield | ||||
| 		sf.push_back(featureGenerator(StackFeature::GENERAL_DAMAGE_REDUCTION, 1, VLC->spellh->spells[sse.id].powers[sse.level], sse.turnsRemain)); | ||||
| 		break; | ||||
| 	case 29: //fire shield | ||||
| 		sf.push_back(featureGenerator(StackFeature::FIRE_SHIELD, 0, VLC->spellh->spells[sse.id].powers[sse.level], sse.turnsRemain)); | ||||
| 		break; | ||||
| 	case 30: //protection from air | ||||
| 		sf.push_back(featureGenerator(StackFeature::SPELL_DAMAGE_REDUCTION, 0, VLC->spellh->spells[sse.id].powers[sse.level], sse.turnsRemain)); | ||||
| 		break; | ||||
|   | ||||
| @@ -599,7 +599,22 @@ void CGameHandler::prepareAttack(BattleAttack &bat, const CStack *att, const CSt | ||||
| 		bsa->damageAmount *= 2; | ||||
| 		bat.flags |= 4; | ||||
| 	} | ||||
| 	int dmg = bsa->damageAmount; | ||||
| 	prepareAttacked(*bsa, def); | ||||
|  | ||||
| 	//fire shield handling | ||||
| 	if ( !bat.shot() && def->hasFeatureOfType(StackFeature::FIRE_SHIELD) && !bsa->killed() ) | ||||
| 	{ | ||||
| 		bat.bsa.push_back(BattleStackAttacked()); | ||||
| 		BattleStackAttacked *bsa = &bat.bsa.back(); | ||||
| 		bsa->stackAttacked = att->ID; | ||||
| 		bsa->attackerID = def->ID; | ||||
| 		bsa->flags |= 2; | ||||
| 		bsa->effect = 11; | ||||
|  | ||||
| 		bsa->damageAmount = (dmg * def->valOfFeatures(StackFeature::FIRE_SHIELD)) / 100; | ||||
| 		prepareAttacked(*bsa, att); | ||||
| 	} | ||||
| } | ||||
| void CGameHandler::handleConnection(std::set<int> players, CConnection &c) | ||||
| { | ||||
| @@ -3403,6 +3418,7 @@ void CGameHandler::handleSpellCasting( int spellID, int spellLvl, int destinatio | ||||
| 		} | ||||
| 	case 27: //shield  | ||||
| 	case 28: //air shield | ||||
| 	case 29: //fire shield | ||||
| 	case 30: //protection from air | ||||
| 	case 31: //protection from fire | ||||
| 	case 32: //protection from water | ||||
|   | ||||
		Reference in New Issue
	
	Block a user