1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

General tweaking of specialities for general consistency.

Values now grow with level. Warning: they affect entire hero himself, not the specific type of creature.
This commit is contained in:
DjWarmonger 2010-07-08 19:10:26 +00:00
parent 94f7ee41e2
commit 24b47ce006
6 changed files with 208 additions and 149 deletions

View File

@ -1,149 +1,149 @@
Hero ID Bonus Type Val Subtype Additional Info
0 2 1 0 5
1 1 2 0 0
2 1 4 0 0
3 2 5 1 2
4 2 13 0 5
5 1 6 0 0
6 1 146 0 0
7 1 10 0 0
8 2 27 0 5
"Hero ID" "Bonus Type" "Val" "Subtype" "Additional Info"
0 2 5 1 0
1 1 0 0 2
2 1 0 0 4
3 2 2 5 1
4 2 5 13 0
5 1 0 0 6
6 1 0 0 146
7 1 0 0 10
8 2 5 27 0
9 6 41 0 3
10 8 45 0 0
11 3 20 0 3
12 1 8 0 0
13 2 11 0 5
12 1 0 0 8
13 2 5 11 0
14 8 48 0 0
15 10 350 6 0
16 2 23 0 5
17 1 16 0 0
16 2 5 23 0
17 1 0 0 16
18 10 350 6 0
19 1 22 0 0
20 2 26 0 5
21 1 18 0 0
22 1 24 0 0
23 2 2 0 5
19 1 0 0 22
20 2 5 26 0
21 1 0 0 18
22 1 0 0 24
23 2 5 2 0
24 8 55 1 0
25 3 37 0 3
26 2 24 0 5
27 2 27 0 5
28 2 11 0 5
26 2 5 24 0
27 2 5 27 0
28 2 5 11 0
29 7 51 0 0
30 3 16 0 3
31 1 20 0 0
32 1 30 0 0
33 1 36 0 0
34 1 32 0 0
35 2 23 0 5
36 1 146 0 0
37 1 38 0 0
31 1 0 0 20
32 1 0 0 30
33 1 0 0 36
34 1 0 0 32
35 2 5 23 0
36 1 0 0 146
37 1 0 0 38
38 10 1 1 0
39 1 36 0 0
39 1 0 0 36
40 3 60 0 3
41 2 8 1 5
42 2 11 0 5
41 2 5 8 1
42 2 5 11 0
43 7 51 0 0
44 1 34 0 0
44 1 0 0 34
45 3 19 0 3
46 8 53 0 0
47 10 350 6 0
48 1 46 0 0
49 1 52 0 0
50 1 48 0 0
51 1 42 0 0
48 1 0 0 46
49 1 0 0 52
50 1 0 0 48
51 1 0 0 42
52 10 350 6 0
53 1 42 0 0
54 1 146 0 0
55 1 50 0 0
56 2 24 0 5
53 1 0 0 42
54 1 0 0 146
55 1 0 0 50
56 2 5 24 0
57 3 22 0 3
58 2 8 1 5
58 2 5 8 1
59 8 45 0 0
60 10 1 3 0
61 8 43 0 0
62 2 25 0 5
62 2 5 25 0
63 3 21 0 3
64 1 58 0 0
65 1 62 0 0
66 1 64 0 0
67 1 60 0 0
68 1 66 0 0
69 2 12 0 5
64 1 0 0 58
65 1 0 0 62
66 1 0 0 64
67 1 0 0 60
68 1 0 0 66
69 2 5 12 0
70 10 350 6 0
71 1 56 0 0
71 1 0 0 56
72 3 24 0 3
73 3 23 0 3
74 2 25 0 5
75 2 11 1 5
74 2 5 25 0
75 2 5 11 1
76 3 39 0 3
77 8 46 0 0
78 2 12 0 5
78 2 5 12 0
79 10 350 6 0
80 1 72 0 0
81 1 146 0 0
82 1 78 0 0
83 1 74 0 0
80 1 0 0 72
81 1 0 0 146
82 1 0 0 78
83 1 0 0 74
84 10 350 6 0
85 2 2 0 5
86 1 80 0 0
87 1 70 0 0
85 2 5 2 0
86 1 0 0 80
87 1 0 0 70
88 3 38 0 3
89 2 8 1 5
90 2 25 0 5
89 2 5 8 1
90 2 5 25 0
91 3 38 0 3
92 2 11 1 5
92 2 5 11 1
93 3 23 0 3
94 10 1 4 0
95 8 46 0 0
96 1 94 0 0
97 1 146 0 0
98 1 88 0 0
99 1 92 0 0
101 1 84 0 0
102 1 90 0 0
103 2 22 0 5
104 1 86 0 0
105 2 25 0 5
106 1 90 0 0
107 2 2 0 5
96 1 0 0 94
97 1 0 0 146
98 1 0 0 88
99 1 0 0 92
101 1 0 0 84
102 1 0 0 90
103 2 5 22 0
104 1 0 0 86
105 2 5 25 0
106 1 0 0 90
107 2 5 2 0
108 8 53 0 0
109 8 44 0 0
110 2 25 0 5
111 2 11 1 5
110 2 5 25 0
111 2 5 11 1
112 10 1 5 0
113 1 106 0 0
114 1 98 0 0
115 1 100 0 0
116 2 23 0 5
117 1 102 0 0
118 1 104 0 0
119 1 146 0 0
120 1 108 0 0
121 2 8 1 5
122 2 5 1 2
123 2 27 0 5
113 1 0 0 106
114 1 0 0 98
115 1 0 0 100
116 2 5 23 0
117 1 0 0 102
118 1 0 0 104
119 1 0 0 146
120 1 0 0 108
121 2 5 8 1
122 2 2 5 1
123 2 5 27 1
124 8 46 0 0
125 2 25 0 5
126 2 24 0 5
127 2 11 1 5
128 4 120 1 3
128 4 120 2 3
129 4 113 1 2
129 4 113 1 1
129 4 113 4 5
130 4 114 1 1
130 4 114 1 2
130 4 114 3 2
131 4 115 1 2
132 4 120 1 3
132 4 120 2 3
133 4 113 1 2
133 4 113 1 1
133 4 113 4 5
134 4 114 1 1
134 4 114 1 2
134 4 114 3 2
135 4 115 1 2
125 2 5 25 0
126 2 5 24 0
127 2 5 11 1
128 4 3 1 120
128 4 3 2 120
129 4 2 1 113
129 4 1 1 113
129 4 5 4 113
130 4 1 1 114
130 4 2 1 114
130 4 2 3 114
131 4 2 1 115
132 4 3 1 120
132 4 3 2 120
133 4 2 1 113
133 4 1 1 113
133 4 5 4 113
134 4 1 1 114
134 4 2 1 114
134 4 2 3 114
135 4 2 1 115
136 5 13 0 100
137 8 53 0 0
138 5 15 0 50
@ -154,23 +154,23 @@ Hero ID Bonus Type Val Subtype Additional Info
143 10 350 6 0
144 12 2 0 0
145 11 14 0 0
146 1 4 0 0
146 1 0 0 4
147 9 8 0 136
147 9 34 0 136
148 9 2 0 137
148 9 18 0 137
149 4 96 1 5
149 4 96 2 5
149 4 96 3 10
150 4 66 1 5
150 4 66 2 5
150 4 66 3 10
149 4 5 1 96
149 4 5 2 96
149 4 10 3 96
150 4 5 1 66
150 4 5 2 66
150 4 10 3 66
151 13 1 1 5
151 13 1 2 5
152 1 4 0 0
152 1 0 0 4
153 13 1 1 5
153 13 1 1 5
154 1 90 0 0
155 4 54 1 4
155 4 54 2 2
155 4 54 5 1
154 1 0 0 90
155 4 4 1 54
155 4 2 2 54
155 4 1 5 54

View File

@ -946,43 +946,48 @@ void CGHeroInstance::initObj()
{
case 1:// creature speciality
{
bonus.type = Bonus::SPECIAL_CREATURE_LEV; // general info to indicate type of growing bonus
bonus.additionalInfo = it->additionalinfo; //base creature ID
speciality.bonuses.push_back (bonus);
std::vector<CCreature*>* creatures = &VLC->creh->creatures;
int creLevel = (*creatures)[it->val]->level;
if(!creLevel)
int creLevel = (*creatures)[it->additionalinfo]->level;
if(!creLevel) //TODO: set fixed level for War Machines
{
if(it->val == 146)
if(it->additionalinfo == 146)
creLevel = 5; //treat ballista as 5-level
else
{
tlog2 << "Warning: unknown level of " << (*creatures)[it->val]->namePl << std::endl;
tlog2 << "Warning: unknown level of " << (*creatures)[it->additionalinfo]->namePl << std::endl;
continue;
}
}
speciality.growthsWithLevel = true;
bonus.type = Bonus::SPECIAL_CREATURE;
bonus.type = Bonus::PRIMARY_SKILL; //TODO: limit to specific creature type
bonus.valType = Bonus::ADDITIVE_VALUE;
bonus.subtype = 1; //attack
bonus.additionalInfo = level/creLevel * (*creatures)[it->val]->attack;
bonus.val = level * (*creatures)[it->additionalinfo]->attack / (*creatures)[it->additionalinfo]->level /20;
speciality.bonuses.push_back (bonus);
bonus.subtype = 2; //defense
bonus.additionalInfo = level/creLevel * (*creatures)[it->val]->defence;
bonus.val = level * (*creatures)[it->additionalinfo]->defence / (*creatures)[it->additionalinfo]->level /20;
speciality.bonuses.push_back (bonus);
bonus.subtype = 5;
bonus.additionalInfo = 1; //+1 speed
bonus.type = Bonus::STACKS_SPEED;
bonus.val = 1; //+1 speed
speciality.bonuses.push_back (bonus);
for (std::set<ui32>::iterator i = (*creatures)[it->val]->upgrades.begin();
i != VLC->creh->creatures[it->val]->upgrades.end(); i++)
for (std::set<ui32>::iterator i = (*creatures)[it->additionalinfo]->upgrades.begin();
i != VLC->creh->creatures[it->additionalinfo]->upgrades.end(); i++)
{
bonus.val = *i; // for all direct upgrades of that creature
bonus.val = (*i); // for all direct upgrades of that creature
bonus.type = Bonus::PRIMARY_SKILL;
bonus.subtype = 1; //attack
bonus.additionalInfo = level/(*creatures)[*i]->level * (*creatures)[*i]->attack;
bonus.val = level * (*creatures)[*i]->attack / (*creatures)[*i]->level /20;
speciality.bonuses.push_back (bonus);
bonus.subtype = 2; //defense
bonus.additionalInfo = level/(*creatures)[*i]->level * (*creatures)[*i]->defence;
bonus.val = level * (*creatures)[*i]->defence / (*creatures)[*i]->level /20;
speciality.bonuses.push_back (bonus);
bonus.subtype = 5;
bonus.additionalInfo = 1; //+1 speed
bonus.type = Bonus::STACKS_SPEED;
bonus.val = 1; //+1 speed
speciality.bonuses.push_back (bonus);
}
}
@ -1002,6 +1007,8 @@ void CGHeroInstance::initObj()
break;
}
speciality.bonuses.push_back (bonus);
bonus.val = valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, it->subtype) * it->val/100; //TODO: limit range to hero only
speciality.bonuses.push_back(bonus);
break;
case 3://spell damage bonus, level dependant
speciality.growthsWithLevel = true;
@ -1011,9 +1018,21 @@ void CGHeroInstance::initObj()
speciality.bonuses.push_back (bonus);
break;
case 4://creature stat boost
bonus.type = Bonus::SPECIAL_CREATURE;
switch (it->subtype)
{
case 1://attack
case 2://defense
bonus.type = Bonus::PRIMARY_SKILL;
bonus.subtype = it->subtype;
break;
case 5:
bonus.type = Bonus::STACKS_SPEED;
bonus.subtype = 0;
break;
default:
continue; //TODO: damage, hp
}
bonus.valType = Bonus::ADDITIVE_VALUE;
bonus.subtype = it->subtype;
bonus.additionalInfo = it->additionalinfo;
speciality.bonuses.push_back (bonus);
break;
@ -1064,15 +1083,15 @@ void CGHeroInstance::initObj()
speciality.bonuses.push_back (bonus);
break;
case 13://Dragon bonuses (Mutare)
bonus.type = Bonus::SPECIAL_CREATURE;
bonus.type = Bonus::PRIMARY_SKILL;
bonus.valType = Bonus::ADDITIVE_VALUE;
bonus.additionalInfo = it->additionalinfo; //value
bonus.additionalInfo = it->additionalinfo; //id
bonus.subtype = it->subtype; //which stat it is
for (std::vector<CCreature*>::iterator i = VLC->creh->creatures.begin(); i != VLC->creh->creatures.end(); i++)
{ //TODO: what if creature changes type during the game (Dragon Eye Ring?)
if ((*i)->hasBonusOfType(Bonus::DRAGON_NATURE)) //TODO: implement it!
{
bonus.val = (*i)->idNumber; //for each Dragon separately
bonus.additionalInfo = (*i)->idNumber; //for each Dragon separately
speciality.bonuses.push_back (bonus);
}
}
@ -1081,10 +1100,7 @@ void CGHeroInstance::initObj()
tlog2 << "Unexpected hero speciality " << type <<'\n';
}
}
if (speciality.growthsWithLevel)
speciality.recalculateSpecials();
}
void CGHeroInstance::setPropertyDer( ui8 what, ui32 val )
{
if(what == ObjProperty::PRIMARY_STACK_COUNT)

View File

@ -46,9 +46,9 @@ struct TerrainTile;
struct InfoWindow;
struct Component;
struct BankConfig;
struct UpdateHeroSpeciality;
class CGBoat;
class DLL_EXPORT CCastleEvent
{
public:
@ -305,7 +305,6 @@ public:
struct DLL_EXPORT HeroSpecial : CBonusSystemNode
{
bool growthsWithLevel;
void recalculateSpecials(){};
template <typename Handler> void serialize(Handler &h, const int version)
{
h & static_cast<CBonusSystemNode&>(*this);

View File

@ -151,7 +151,6 @@ namespace PrimarySkill
BONUS_NAME(SPECIAL_CREATURE_LEV) /*val = base id*/ \
BONUS_NAME(SPECIAL_SECONDARY_SKILL) /*val = id, additionalInfo = value per level in percent*/ \
BONUS_NAME(SPECIAL_SPELL_LEV) /*val = id, additionalInfo = value per level in percent*/\
BONUS_NAME(SPECIAL_CREATURE) /*val = base id, subtype = stat, additionalInfo = value*/\
BONUS_NAME(SPECIFIC_SPELL_DAMAGE) /*val = id of spell, additionalInfo = value*/\
BONUS_NAME(SPECIAL_BLESS_DAMAGE) /*val = spell (bless), additionalInfo = value per level in percent*/\
BONUS_NAME(MAXED_SPELL) /*val = id*/\
@ -295,6 +294,14 @@ struct DLL_EXPORT Bonus
{
return type == cf;
}
inline void ChangeBonusVal (const ui32 newVal)
{
val = newVal;
}
inline void operator += (const ui32 Val) //no return
{
val += Val;
}
const CSpell * sourceSpell() const;
std::string Description() const;

View File

@ -1204,7 +1204,6 @@ struct AdvmapSpellCast : public CPackForClient //108
}
};
/***********************************************************************************************************/
struct CloseServer : public CPackForServer

View File

@ -700,7 +700,45 @@ DLL_EXPORT void SetHoverName::applyGs( CGameState *gs )
DLL_EXPORT void HeroLevelUp::applyGs( CGameState *gs )
{
gs->getHero(heroid)->level = level;
CGHeroInstance* h = gs->getHero(heroid);
h->level = level;
//speciality
if (h->speciality.growthsWithLevel)
{
std::vector<CCreature*>* creatures = &VLC->creh->creatures;
for (std::list<Bonus>::iterator it = h->speciality.bonuses.begin(); it != h->speciality.bonuses.end(); it++)
{
switch (it->type)
{
case Bonus::SECONDARY_SKILL_PREMY:
it->val = (h->speciality.valOfBonuses(Bonus::SPECIAL_SECONDARY_SKILL, it->subtype) *
h->valOfBonuses(Bonus::SECONDARY_SKILL_PREMY,it->subtype) * h->level)/100;
break;
case Bonus::PRIMARY_SKILL:
int creLevel = (*creatures)[it->additionalInfo]->level;
if(!creLevel)
{
if(it->additionalInfo == 146)
creLevel = 5; //treat ballista as 5-level
else
{
tlog2 << "Warning: unknown level of " << (*creatures)[it->val]->namePl << std::endl;
continue;
}
}
switch (it->subtype)
{
case 1:
it->val = (level * (*creatures)[it->additionalInfo]->attack)/creLevel /20;
break;
case 2:
it->val = (level * (*creatures)[it->additionalInfo]->defence)/creLevel /20;
break;
}
break;
}
}
}
}
DLL_EXPORT void BattleStart::applyGs( CGameState *gs )