defence 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # defence
  2. if defence <= 0:
  3. set defence = 0
  4. set defenceM = 0
  5. set defenceW = 0
  6. set defenceActPar = 0
  7. set defenceActParM = 0
  8. set defenceAct = 0
  9. set defenceActM = 0
  10. set defAtk = 0
  11. set defAtkM = 0
  12. end
  13. if defenceV <= 0:
  14. set defenceV = 0
  15. set defenceMV = 0
  16. set defenceWV = 0
  17. set defenceActParV = 0
  18. set defenceActParMV = 0
  19. set defenceActV = 0
  20. set defenceActMV = 0
  21. set defAtkV = 0
  22. set defAtkMV = 0
  23. end
  24. if defenceAct > 0:
  25. set defence += defenceActPar
  26. set defenceAct -= 1
  27. set defActParK = defenceActPar/100
  28. set manna -= defActParK
  29. '<b><font color="green">Regeneration consumes Protection <<defActParK>> units manna.</font></b>'
  30. end
  31. if defenceActM > 0:
  32. set defenceM += defenceActParM
  33. set defenceActM -= 1
  34. set defActParKM = defenceActParM/100
  35. set manna -= defActParKM
  36. '<b><font color="green">Regeneration consumes magical protection <<defActParKM>> units of manna.</font></b>'
  37. end
  38. if defenceActV > 0:
  39. set defenceV += defenceActParV
  40. set defenceActV -= 1
  41. set mannaV -= (defenceActParV / 100)
  42. end
  43. if defenceActMV > 0:
  44. set defenceMV += defenceActParMV
  45. set defenceActMV -= 1
  46. set mannaV -= (defenceActParMV / 100)
  47. end
  48. if defAtk > 0:
  49. set 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. set 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. set defAtkM -= 1
  60. if defenceMV <= 0 and unmaterialV = 0:
  61. set defDamM = rand(defenceActParM/2, defenceActParM)
  62. set mannaV -= defDamM
  63. set 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. set 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. set defAtkMV -= 1
  74. if defenceM <= 0 and unmaterial = 0:
  75. set defDamMV = rand(defenceActParMV/2, defenceActParMV)
  76. set manna -= defDamMV
  77. set 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. set 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 ---------------------------------
  87. # ----------
  88. --- ---------- ---------------------------------