Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //тут тип от 0 лучше начинать и не включительно
- // 0..<x
- private static func doDamageToOpp(damage:Int,res0:Res)->Res{
- var res = res0
- for _ in 0..<damage {
- if (arrEffects(eff: res.oppEff)[4] > 0){
- res.oppEff = deleteEffects(eff: res.oppEff, delEff: "b", isOnlyOneDeleting: true, deleteAllEffs: false)
- }else{
- res.oppHealth -= 1
- }
- }
- return res
- }
- private static func doDamageToMe(damage:Int,res0:Res)->Res{
- var res = res0
- for _ in 0..<damage {
- if (arrEffects(eff: res.myEff)[4] > 0){
- res.myEff = deleteEffects(eff: res.myEff, delEff: "b", isOnlyOneDeleting: true, deleteAllEffs: false)
- }else{
- res.myHealth -= 1
- }
- }
- return res
- }
- // ну и после проверки на фейк спелл можно еще такую штуку засунуть чтобы если нет брони не давало вообще сыграть
- guard !((curSpell[0]*10+curSpell[1] == 36 || curSpell[0]*10+curSpell[1] == 63) && BattleUtils.arrEffects(eff: myEff)[4] == 0) else {
- print("You have 0 armor")
- curSpell = [0,0]
- spiralColor()
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement