Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.72 KB | None | 0 0
  1. fun addEffects(effect: Array<Effect>){
  2.         statsEffect.fill(0)
  3.         for (singleEffect in effect){
  4.             if(singleEffect.duration>=0) {
  5.                 if (singleEffect.type == EffectType.STRENGTH) {
  6.                     statsEffect[Stats.STR] += singleEffect.strength
  7.                     singleEffect.duration.dec()
  8.                 }
  9.                 if (singleEffect.type == EffectType.INTELLIGENCE) {
  10.                     statsEffect[Stats.INT] += singleEffect.strength
  11.                     singleEffect.duration.dec()
  12.                 }
  13.                 if (singleEffect.type == EffectType.DEXTRITY) {
  14.                     statsEffect[Stats.DEX] += singleEffect.strength
  15.                     singleEffect.duration.dec()
  16.                 }
  17.                 if (singleEffect.type == EffectType.POISON) {
  18.                     heal(-singleEffect.strength)
  19.                     singleEffect.duration.dec()
  20.                 }
  21.                 if (singleEffect.type == EffectType.RAGE) {
  22.                     statsEffect[Stats.STR] += singleEffect.strength
  23.                     singleEffect.duration.dec()
  24.                 }
  25.                 if (singleEffect.type == EffectType.FORTUNE) {
  26.                     statsEffect[Stats.FRT] += singleEffect.strength
  27.                     singleEffect.duration.dec()
  28.                 }
  29.                 if (singleEffect.type == EffectType.ENDURANCE) {
  30.                     statsEffect[Stats.END] += singleEffect.strength
  31.                     singleEffect.duration.dec()
  32.                 }
  33.                 if (singleEffect.type == EffectType.REGENERATION) {
  34.                     heal(singleEffect.strength)
  35.                     singleEffect.duration.dec()
  36.                 }
  37.             }
  38.         }
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement