Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. //тут тип от 0 лучше начинать и не включительно
  2. // 0..<x
  3. private static func doDamageToOpp(damage:Int,res0:Res)->Res{
  4. var res = res0
  5. for _ in 0..<damage {
  6. if (arrEffects(eff: res.oppEff)[4] > 0){
  7. res.oppEff = deleteEffects(eff: res.oppEff, delEff: "b", isOnlyOneDeleting: true, deleteAllEffs: false)
  8. }else{
  9. res.oppHealth -= 1
  10. }
  11. }
  12. return res
  13. }
  14.  
  15. private static func doDamageToMe(damage:Int,res0:Res)->Res{
  16. var res = res0
  17. for _ in 0..<damage {
  18. if (arrEffects(eff: res.myEff)[4] > 0){
  19. res.myEff = deleteEffects(eff: res.myEff, delEff: "b", isOnlyOneDeleting: true, deleteAllEffs: false)
  20. }else{
  21. res.myHealth -= 1
  22. }
  23. }
  24. return res
  25. }
  26.  
  27.  
  28.  
  29. // ну и после проверки на фейк спелл можно еще такую штуку засунуть чтобы если нет брони не давало вообще сыграть
  30. guard !((curSpell[0]*10+curSpell[1] == 36 || curSpell[0]*10+curSpell[1] == 63) && BattleUtils.arrEffects(eff: myEff)[4] == 0) else {
  31. print("You have 0 armor")
  32. curSpell = [0,0]
  33. spiralColor()
  34. return
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement