Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun addEffects(effect: Array<Effect>){
- statsEffect.fill(0)
- for (singleEffect in effect){
- if(singleEffect.duration>=0) {
- if (singleEffect.type == EffectType.STRENGTH) {
- statsEffect[Stats.STR] += singleEffect.strength
- singleEffect.duration.dec()
- }
- if (singleEffect.type == EffectType.INTELLIGENCE) {
- statsEffect[Stats.INT] += singleEffect.strength
- singleEffect.duration.dec()
- }
- if (singleEffect.type == EffectType.DEXTRITY) {
- statsEffect[Stats.DEX] += singleEffect.strength
- singleEffect.duration.dec()
- }
- if (singleEffect.type == EffectType.POISON) {
- heal(-singleEffect.strength)
- singleEffect.duration.dec()
- }
- if (singleEffect.type == EffectType.RAGE) {
- statsEffect[Stats.STR] += singleEffect.strength
- singleEffect.duration.dec()
- }
- if (singleEffect.type == EffectType.FORTUNE) {
- statsEffect[Stats.FRT] += singleEffect.strength
- singleEffect.duration.dec()
- }
- if (singleEffect.type == EffectType.ENDURANCE) {
- statsEffect[Stats.END] += singleEffect.strength
- singleEffect.duration.dec()
- }
- if (singleEffect.type == EffectType.REGENERATION) {
- heal(singleEffect.strength)
- singleEffect.duration.dec()
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement