defence.qsrc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # defence
  2. !! Old code commented out but there for reference
  3. !!{
  4. if defence <= 0:
  5. defence = 0
  6. defenceM = 0
  7. defenceW = 0
  8. defenceActPar = 0
  9. defenceActParM = 0
  10. defenceAct = 0
  11. defenceActM = 0
  12. defAtk = 0
  13. defAtkM = 0
  14. end
  15. if defenceV <= 0:
  16. defenceV = 0
  17. defenceMV = 0
  18. defenceWV = 0
  19. defenceActParV = 0
  20. defenceActParMV = 0
  21. defenceActV = 0
  22. defenceActMV = 0
  23. defAtkV = 0
  24. defAtkMV = 0
  25. end
  26. if defenceAct > 0:
  27. defence += defenceActPar
  28. defenceAct -= 1
  29. defActParK = defenceActPar/100
  30. pcs_mana -= defActParK
  31. '<b><font color="green">Regeneration consumes <<defActParK>> units of mana.</font></b>'
  32. end
  33. if defenceActM > 0:
  34. defenceM += defenceActParM
  35. defenceActM -= 1
  36. defActParKM = defenceActParM/100
  37. pcs_mana -= defActParKM
  38. '<b><font color="green">Regeneration consumes <<defActParKM>> units of mana.</font></b>'
  39. end
  40. if defenceActV > 0:
  41. defenceV += defenceActParV
  42. defenceActV -= 1
  43. manaV -= (defenceActParV / 100)
  44. end
  45. if defenceActMV > 0:
  46. defenceMV += defenceActParMV
  47. defenceActMV -= 1
  48. manaV -= (defenceActParMV / 100)
  49. end
  50. if defAtk > 0:
  51. defAtk -= 1
  52. '<b><font color="green">You protection shield counter-attack the enemy.</font></b>'
  53. gs 'atakB', 'atak'
  54. end
  55. if defAtkV > 0:
  56. defAtkV -= 1
  57. '<b><font color="red">The enemy''s protection shield counter-attacks you.</font></b>'
  58. gs 'atakB1', 'atak'
  59. end
  60. if defAtkM > 0:
  61. defAtkM -= 1
  62. if defenceMV <= 0 and unmaterialV = 0:
  63. defDamM = rand(defenceActParM/2, defenceActParM)
  64. manaV -= defDamM
  65. defence += defDamM
  66. '<b><font color="green">Your protection shield absorbed <<defDamM>> mana from an enemy, this mana converts into strengthening your defenses.</font></b>'
  67. end
  68. if defenceMV > 0:
  69. defenceMV += defenceActParM
  70. '<b><font color="green">Your protection shield caused <<defenceActParM>> points of damage to your enemy''s mana.</font></b>'
  71. end
  72. if unmaterialV > 0:'<b><font color="green">Your protection shield is trying to absorb the enemy''s attack but it does not work, the enemy is too strong.</font></b>'
  73. end
  74. if defAtkMV > 0:
  75. defAtkMV -= 1
  76. if defenceM <= 0 and unmaterial = 0:
  77. defDamMV = rand(defenceActParMV/2, defenceActParMV)
  78. pcs_mana -= defDamMV
  79. defenceV += defDamMV
  80. '<b><font color="red">You enemy takes <<defDamMV>> mana from you strengthening their defense.</font></b>'
  81. end
  82. if defenceM > 0:
  83. defenceM += defenceActParMV
  84. '<b><font color="red">The protection shield inflicts <<defenceActParMV>> points of damage.</font></b>'
  85. end
  86. if unmaterial > 0:'<b><font color="red">The enemy''s protection shield is trying to absorb your mana but it does not work.</font></b>'
  87. end
  88. }
  89. --- defence ---------------------------------