1
0

defence 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # defence
  2. if defence <= 0:
  3. defence = 0
  4. defenceM = 0
  5. defenceW = 0
  6. defenceActPar = 0
  7. defenceActParM = 0
  8. defenceAct = 0
  9. defenceActM = 0
  10. defAtk = 0
  11. defAtkM = 0
  12. end
  13. if defenceV <= 0:
  14. defenceV = 0
  15. defenceMV = 0
  16. defenceWV = 0
  17. defenceActParV = 0
  18. defenceActParMV = 0
  19. defenceActV = 0
  20. defenceActMV = 0
  21. defAtkV = 0
  22. defAtkMV = 0
  23. end
  24. if defenceAct > 0:
  25. defence += defenceActPar
  26. defenceAct -= 1
  27. defActParK = defenceActPar/100
  28. manna -= defActParK
  29. '<b><font color="green">Regeneration consumes Protection <<defActParK>> units manna.</font></b>'
  30. end
  31. if defenceActM > 0:
  32. defenceM += defenceActParM
  33. defenceActM -= 1
  34. defActParKM = defenceActParM/100
  35. manna -= defActParKM
  36. '<b><font color="green">Regeneration consumes magical protection <<defActParKM>> units of manna.</font></b>'
  37. end
  38. if defenceActV > 0:
  39. defenceV += defenceActParV
  40. defenceActV -= 1
  41. mannaV -= (defenceActParV / 100)
  42. end
  43. if defenceActMV > 0:
  44. defenceMV += defenceActParMV
  45. defenceActMV -= 1
  46. mannaV -= (defenceActParMV / 100)
  47. end
  48. if defAtk > 0:
  49. defAtk -= 1
  50. '<b><font color="green">Your defense is attacking the enemy.</font></b>'
  51. gs 'atakB', 'atak'
  52. end
  53. if defAtkV > 0:
  54. defAtkV -= 1
  55. '<b><font color="red">Protection of the enemy attacks you.</font></b>'
  56. gs 'atakB1', 'atak'
  57. end
  58. if defAtkM > 0:
  59. defAtkM -= 1
  60. if defenceMV <= 0 and unmaterialV = 0:
  61. defDamM = rand(defenceActParM/2, defenceActParM)
  62. mannaV -= defDamM
  63. defence += defDamM
  64. '<b><font color="green">Your defense absorbed <<defDamM>> mana from an enemy, this manna went to strengthen your defenses.</font></b>'
  65. end
  66. if defenceMV > 0:
  67. defenceMV += defenceActParM
  68. '<b><font color="green">Your defense caused <<defenceActParM>> points of damage protection from damage enemy mana.</font></b>'
  69. end
  70. if unmaterialV > 0:'<b><font color="green">Your defense is trying to absorb the manna but it does not work, the enemy is not material.</font></b>'
  71. end
  72. if defAtkMV > 0:
  73. defAtkMV -= 1
  74. if defenceM <= 0 and unmaterial = 0:
  75. defDamMV = rand(defenceActParMV/2, defenceActParMV)
  76. manna -= defDamMV
  77. defenceV += defDamMV
  78. '<b><font color="red">Protection of the enemy swallow <<defDamMV>> manna from you and this manna went to strengthen the defense.</font></b>'
  79. end
  80. if defenceM > 0:
  81. defenceM += defenceActParMV
  82. '<b><font color="red">Protection against your magic damage inflicted damage <<defenceActParMV>> units.</font></b>'
  83. end
  84. if unmaterial > 0:'<b><font color="red">Protection of the enemy is trying to absorb your manna but it does not work.</font></b>'
  85. end
  86. --- defence ---------------------------------