1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

* Fixed bug #72

* Implemented artifacts: Wizard's Well, Ring of the Magi, Cornucopia.
* Partially implemented artifacts: Armageddon's Blade,  Angelic Alliance, Cloak of the Undead King, Armor of the Damned, Power of the Dragon Father, Titan's Thunder, Admiral's Hat, Bow of the Sharpshooter.
Most of these only have their bonuses set.
* Updated AUTHORS
This commit is contained in:
OnionKnight 2009-08-21 19:31:41 +00:00
parent f4743d2fc6
commit 9bc40f1a8d
6 changed files with 110 additions and 37 deletions

View File

@ -36,3 +36,6 @@ Frank Zago aka ubuntux, <>
Trevor Standley aka tstandley <>
* adventure map part of Genius AI
Rickard Westerlund aka Onion Knight, <onionknigh@gmail.com>
* battle functionality and general support

View File

@ -556,10 +556,17 @@ bool CCallback::battleCanShoot(int ID, int dest)
if(our->hasFeatureOfType(StackFeature::FORGETFULL)) //forgetfulness
return false;
// See if the stack can benefit from the Bow of the Sharpshooter.
int ourHero = our->attackerOwned ? gs->curB->hero1 : gs->curB->hero2;
bool hasSharpshooterBow = false;
if (ourHero != -1)
hasSharpshooterBow = gs->getHero(ourHero)->getArtPos(137) != -1;
if(our->hasFeatureOfType(StackFeature::SHOOTER)//it's shooter
&& our->owner != dst->owner
&& dst->alive()
&& !gs->curB->isStackBlocked(ID)
&& (!gs->curB->isStackBlocked(ID) || hasSharpshooterBow)
&& our->shots
)
return true;

View File

@ -157,59 +157,59 @@ void CArtHandler::addBonuses()
//Attack bonus artifacts (Weapons)
ART_PRIM_SKILL(7,0,+2); //Centaur Axe
ART_PRIM_SKILL(8,0,+3);
ART_PRIM_SKILL(9,0,+4);
ART_PRIM_SKILL(10,0,+5);
ART_PRIM_SKILL(11,0,+6);
ART_PRIM_SKILL(12,0,+12);
ART_PRIM_SKILL(12,1,-3);
ART_PRIM_SKILL(8,0,+3); //Blackshard of the Dead Knight
ART_PRIM_SKILL(9,0,+4); //Greater Gnoll's Flail
ART_PRIM_SKILL(10,0,+5); //Ogre's Club of Havoc
ART_PRIM_SKILL(11,0,+6); //Sword of Hellfire
ART_PRIM_SKILL(12,0,+12); //Titan's Gladius
ART_PRIM_SKILL(12,1,-3); //Titan's Gladius
//Defense bonus artifacts (Shields)
ART_PRIM_SKILL(13,1,+2); //Shield of the Dwarven Lords
ART_PRIM_SKILL(14,1,+3);
ART_PRIM_SKILL(15,1,+4);
ART_PRIM_SKILL(16,1,+5);
ART_PRIM_SKILL(17,1,+6);
ART_PRIM_SKILL(18,1,+12);
ART_PRIM_SKILL(18,0,-3);
ART_PRIM_SKILL(14,1,+3); //Shield of the Yawning Dead
ART_PRIM_SKILL(15,1,+4); //Buckler of the Gnoll King
ART_PRIM_SKILL(16,1,+5); //Targ of the Rampaging Ogre
ART_PRIM_SKILL(17,1,+6); //Shield of the Damned
ART_PRIM_SKILL(18,1,+12); //Sentinel's Shield
ART_PRIM_SKILL(18,0,-3); //Sentinel's Shield
//Knowledge bonus artifacts (Helmets)
ART_PRIM_SKILL(19,3,+1); //Helm of the Alabaster Unicorn
ART_PRIM_SKILL(20,3,+2);
ART_PRIM_SKILL(21,3,+3);
ART_PRIM_SKILL(22,3,+4);
ART_PRIM_SKILL(23,3,+5);
ART_PRIM_SKILL(24,3,+10);
ART_PRIM_SKILL(24,2,-2);
ART_PRIM_SKILL(20,3,+2); //Skull Helmet
ART_PRIM_SKILL(21,3,+3); //Helm of Chaos
ART_PRIM_SKILL(22,3,+4); //Crown of the Supreme Magi
ART_PRIM_SKILL(23,3,+5); //Hellstorm Helmet
ART_PRIM_SKILL(24,3,+10); //Thunder Helmet
ART_PRIM_SKILL(24,2,-2); //Thunder Helmet
//Spell power bonus artifacts (Armours)
ART_PRIM_SKILL(25,2,+1); //Breastplate of Petrified Wood
ART_PRIM_SKILL(26,2,+2);
ART_PRIM_SKILL(27,2,+3);
ART_PRIM_SKILL(28,2,+4);
ART_PRIM_SKILL(29,2,+5);
ART_PRIM_SKILL(30,2,+10);
ART_PRIM_SKILL(30,3,-2);
ART_PRIM_SKILL(26,2,+2); //Rib Cage
ART_PRIM_SKILL(27,2,+3); //Scales of the Greater Basilisk
ART_PRIM_SKILL(28,2,+4); //Tunic of the Cyclops King
ART_PRIM_SKILL(29,2,+5); //Breastplate of Brimstone
ART_PRIM_SKILL(30,2,+10); //Titan's Cuirass
ART_PRIM_SKILL(30,3,-2); //Titan's Cuirass
//All primary skills (various)
ART_ALL_PRIM_SKILLS(31,+1); //Armor of Wonder
ART_ALL_PRIM_SKILLS(32,+2);
ART_ALL_PRIM_SKILLS(33,+3);
ART_ALL_PRIM_SKILLS(34,+4);
ART_ALL_PRIM_SKILLS(35,+5);
ART_ALL_PRIM_SKILLS(32,+2); //Sandals of the Saint
ART_ALL_PRIM_SKILLS(33,+3); //Celestial Necklace of Bliss
ART_ALL_PRIM_SKILLS(34,+4); //Lion's Shield of Courage
ART_ALL_PRIM_SKILLS(35,+5); //Sword of Judgement
ART_ALL_PRIM_SKILLS(36,+6); //Helm of Heavenly Enlightenment
//Attack and Defense (various)
ART_ATTACK_AND_DEFENSE(37,+1); //Quiet Eye of the Dragon
ART_ATTACK_AND_DEFENSE(38,+2);
ART_ATTACK_AND_DEFENSE(39,+3);
ART_ATTACK_AND_DEFENSE(40,+4);
ART_ATTACK_AND_DEFENSE(38,+2); //Red Dragon Flame Tongue
ART_ATTACK_AND_DEFENSE(39,+3); //Dragon Scale Shield
ART_ATTACK_AND_DEFENSE(40,+4); //Dragon Scale Armor
//Spell power and Knowledge (various)
ART_POWER_AND_KNOWLEDGE(41,+1); //Dragonbone Greaves
ART_POWER_AND_KNOWLEDGE(42,+2);
ART_POWER_AND_KNOWLEDGE(43,+3);
ART_POWER_AND_KNOWLEDGE(44,+4);
ART_POWER_AND_KNOWLEDGE(42,+2); //Dragon Wing Tabard
ART_POWER_AND_KNOWLEDGE(43,+3); //Necklace of Dragonteeth
ART_POWER_AND_KNOWLEDGE(44,+4); //Crown of Dragontooth
//Luck and morale
ART_MORALE(45,+1); //Still Eye of the Dragon
@ -329,6 +329,51 @@ void CArtHandler::addBonuses()
giveArtBonus(124,HeroBonus::SPELLS_OF_LEVEL,3,1); //Spellbinder's Hat
giveArtBonus(125,HeroBonus::ENEMY_CANT_ESCAPE,0); //Shackles of War
giveArtBonus(126,HeroBonus::BLOCK_SPELLS_ABOVE_LEVEL,0);//Orb of Inhibition
//Armageddon's Blade
giveArtBonus(128, HeroBonus::SPELL, 3, 26);
ART_ATTACK_AND_DEFENSE(128, +3);
ART_PRIM_SKILL(128, 2, +3);
ART_PRIM_SKILL(128, 3, +6);
//Angelic Alliance
ART_ALL_PRIM_SKILLS(129, +21);
//Cloak of the Undead King
giveArtBonus(130, HeroBonus::SECONDARY_SKILL_PREMY, +30, 12);
//Armor of the Damned
ART_ATTACK_AND_DEFENSE(132, +3);
ART_POWER_AND_KNOWLEDGE(132, +2);
//Power of the Dragon Father
ART_ALL_PRIM_SKILLS(134, +16);
giveArtBonus(134, HeroBonus::MORALE_AND_LUCK, +1);
//Titan's Thunder
ART_ATTACK_AND_DEFENSE(135, +9);
ART_POWER_AND_KNOWLEDGE(135, +8);
giveArtBonus(135, HeroBonus::SPELL, 3, 57);
//Admiral's Hat
giveArtBonus(136, HeroBonus::SEA_MOVEMENT, +1000);
giveArtBonus(136, HeroBonus::WHIRLPOOL_PROTECTION, 0);
giveArtBonus(136, HeroBonus::SEA_MOVEMENT, +500);
giveArtBonus(136, HeroBonus::SPELL, 3, 0);
giveArtBonus(136, HeroBonus::SPELL, 3, 1);
//Bow of the Sharpshooter
giveArtBonus(137, HeroBonus::SECONDARY_SKILL_PREMY, +30, 1);
giveArtBonus(137, HeroBonus::NO_SHOTING_PENALTY, 0);
//Ring of the Magi
giveArtBonus(139, HeroBonus::SPELL_DURATION, +50);
//Cornucopia
giveArtBonus(140, HeroBonus::GENERATE_RESOURCE, +5, 1);
giveArtBonus(140, HeroBonus::GENERATE_RESOURCE, +5, 3);
giveArtBonus(140, HeroBonus::GENERATE_RESOURCE, +5, 4);
giveArtBonus(140, HeroBonus::GENERATE_RESOURCE, +5, 5);
}
void CArtHandler::clear()

View File

@ -5,6 +5,7 @@
#include <list>
#include <string>
#include <vector>
#include <climits>
/*
* CArtHandler.h, part of VCMI engine

View File

@ -1014,6 +1014,8 @@ int CGHeroInstance::getSightRadious() const
si32 CGHeroInstance::manaRegain() const
{
if (getArtPos(138) != -1) // Hero has Wizard's Well equipped.
return manaLimit();
return 1 + getSecSkillLevel(8) + valOfBonuses(HeroBonus::MANA_REGENERATION); //1 + Mysticism level
}

View File

@ -400,7 +400,7 @@ std::vector<int> BattleInfo::getAccessibility(int stackID, bool addOccupiable)
}
}
for(int i=0; i < BFIELD_SIZE ; ++i)
for (int i=0; i < BFIELD_SIZE ; ++i) {
if(
( ( !addOccupiable && dist[i] <= s->Speed() && ac[i] ) || ( addOccupiable && dist[i] <= s->Speed() && isAccessible(i, ac, s->hasFeatureOfType(StackFeature::DOUBLE_WIDE), s->attackerOwned, s->hasFeatureOfType(StackFeature::FLYING), true) ) )//we can reach it
|| (vstd::contains(occupyable, i) && ( dist[ i + (s->attackerOwned ? 1 : -1 ) ] <= s->Speed() ) &&
@ -409,6 +409,21 @@ std::vector<int> BattleInfo::getAccessibility(int stackID, bool addOccupiable)
{
ret.push_back(i);
}
}
// 2-hex creatures should not be able to move to a hex with an inaccesible hex to the left or right
// at the horizontal edges of the battlefield.
if (s->hasFeatureOfType(StackFeature::DOUBLE_WIDE)) {
int i = 0;
while (i < ret.size()) {
if (ret[i]%BFIELD_WIDTH == 1 && ret[i] + 1 != ret[i + 1])
ret.erase(ret.begin() + i);
else if (ret[i]%BFIELD_WIDTH == BFIELD_WIDTH - 1 && (i == 0 || ret[i] - 1 != ret[i - 1]))
ret.erase(ret.begin() + i);
else
i++;
}
}
return ret;
}