Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
{
public override void OnRecoverHp(int amount)
{
this.owner.RecoverHP(amount * 2);
}
}
Ended up on this after slamming my head keyboard in vain for while. Though this doesn't work.
This means that the above effect this.owner.RecoverHP(amount * 2); will make the character heal twice as much as they were just healed for.
So if the character with the passive recovers 2 hp, the effect will trigger, healing the character for *2 of what they just healed, healing the character an extra 4 hp on top of the 2 hp for a total of 6 hp healed all together, and because they just healed an extra 4 hp, it will trigger again, healing them for another 8, then 16, and so on. It infinitely loops, which is what is causing the crash
public class PassiveAbility_doubleheal : Passiveability_Statue
{
public override void OnWaveStart()
{
this._recoveredAmount = 0;
}
public override void OnRecoverHp(int amount)
{
if (this._recoveredAmount == 0)
{
this._recoveredAmount += amount;
this.owner.RecoverHP(amount);
}
if (this._recoveredAmount > 0)
{
this._recoveredAmount = 0;
}
}
private int _recoveredAmount;
}
This will make the passive have a private number called _recoveredAmount , and at the start of the an act it will equal 0
Then whenever you heal, Lets say you heal 4 hp, the game will check if _recoveredAmount is equal to 0 or not, if its equal to 0, the character will heal for another 4 hp, and also increase the private number _recoveredAmount (whatever this increases by doesn't matter as long as it increases by at least 1, The above code increases it by the amount of hp healed to make it easier)
Now because you healed another 4 hp, the game will check this effect again, but because this time _recoveredAmount isn't equal to 0, it doesn't make the character recover hp again, instead, it changes the amount of whatever _recoveredAmount was, and sets it to 0. Making the double heal effect ready for the next time the character heals.
Also, This doesn't have to be _recoveredAmount either, You can change it to whatever you like as long as the rest matches whatever you put next to Private Int, such as changing _RecoveredAmount ---> healingtimeVeryKewl would make the passive look like :
public class PassiveAbility_doubleheal : Passiveability_Statue
{
public override void OnWaveStart()
{
this.healingtimeVeryKewl = 0;
}
public override void OnRecoverHp(int amount)
{
if (this.healingtimeVeryKewl == 0)
{
this.healingtimeVeryKewl += amount;
this.owner.RecoverHP(amount);
}
if (this.healingtimeVeryKewl > 0)
{
this.healingtimeVeryKewl = 0;
}
}
private int healingtimeVeryKewl;
}
public class PassiveAbility_doubleheal : Passiveability_Statue
{
public override void OnRoundStart()
{
this.healingtimeVeryKewl = 0;
}
public override void OnRecoverHp(int amount)
{
if (this.healingtimeVeryKewl == 0 && amount >= 1)
{
this.healingtimeVeryKewl += amount;
this.owner.RecoverHP(0);
}
if (this.healingtimeVeryKewl > 0 && amount >= 1)
{
this.healingtimeVeryKewl = 0;
}
}
private int healingtimeVeryKewl;
}
At the moment a currently also working next passive as well. Haste +1 and Power +1 for every 25% you have. Seeing looking through the game code for what I can example to start from.
do you mean that dice gain +1 by 25% of the characters haste?
if that is the case i already have a mod from one of the ones i posted, that does the same thing basically,
it increases the maximum range of dice by half of the characters haste.
I can share it and you can just change the value from 50% to 25%, and make increase power instead of the maximum range
{
public override void BeforeRollDice(BattleDiceBehavior behavior)
{
int Powerlevel = 4;
if (this.owner.hp < (float)this.owner.MaxHp * 1.00f)
{
Powerlevel = 3;
}
if (this.owner.hp <= (float)this.owner.MaxHp * 0.74f)
{
Powerlevel = 2;
}
if (this.owner.hp <= (float)this.owner.MaxHp * 0.49f)
{
Powerlevel = 1;
}
if (this.owner.hp <= (float)this.owner.MaxHp * 0.24f)
{
Powerlevel = 0;
}
behavior.ApplyDiceStatBonus(new DiceStatBonus
{
power = Powerlevel,
});
}
public override void OnRoundStart()
{
if (this.owner.hp == (float)this.owner.MaxHp * 1.00f)
{
HealthyLevel = 4;
}
else if (this.owner.hp < (float)this.owner.MaxHp * 1.00f && this.owner.hp >= (float)this.owner.MaxHp * 0.75f)
{
HealthyLevel = 3;
}
if (this.owner.hp <= (float)this.owner.MaxHp * 0.74f && this.owner.hp >= (float)this.owner.MaxHp * 0.50f)
{
HealthyLevel = 2;
}
if (this.owner.hp <= (float)this.owner.MaxHp * 0.49f && this.owner.hp >= (float)this.owner.MaxHp * 0.25f)
{
HealthyLevel = 1;
}
if (this.owner.hp <= (float)this.owner.MaxHp * 0.24f)
{
HealthyLevel = 0;
}
}
public override int GetSpeedDiceAdder(int speedDiceResult)
{
return HealthyLevel;
}
private int HealthyLevel;
}