Env.java 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver.model.stats;
  16. import com.l2jserver.gameserver.model.actor.L2Character;
  17. import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. import com.l2jserver.gameserver.model.effects.L2Effect;
  20. import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  21. import com.l2jserver.gameserver.model.skills.L2Skill;
  22. /**
  23. * An Env object is just a class to pass parameters to a calculator such as L2PcInstance, L2ItemInstance, Initial value.
  24. * @author Zoey76
  25. */
  26. public final class Env
  27. {
  28. private double _baseValue;
  29. private boolean _blessedSpiritShot = false;
  30. private L2Character _character;
  31. private L2CubicInstance _cubic;
  32. private L2Effect _effect;
  33. private L2ItemInstance _item;
  34. private byte _shield = 0;
  35. private L2Skill _skill;
  36. private boolean _skillMastery = false;
  37. private boolean _soulShot = false;
  38. private boolean _spiritShot = false;
  39. private L2Character _target;
  40. private double _value;
  41. public Env()
  42. {
  43. //
  44. }
  45. public Env(byte shield, boolean soulShot, boolean spiritShot, boolean blessedSpiritShot)
  46. {
  47. _shield = shield;
  48. _soulShot = soulShot;
  49. _spiritShot = spiritShot;
  50. _blessedSpiritShot = blessedSpiritShot;
  51. }
  52. /**
  53. * @return the _baseValue
  54. */
  55. public double getBaseValue()
  56. {
  57. return _baseValue;
  58. }
  59. /**
  60. * @return the _character
  61. */
  62. public L2Character getCharacter()
  63. {
  64. return _character;
  65. }
  66. /**
  67. * @return the _cubic
  68. */
  69. public L2CubicInstance getCubic()
  70. {
  71. return _cubic;
  72. }
  73. /**
  74. * @return the _effect
  75. */
  76. public L2Effect getEffect()
  77. {
  78. return _effect;
  79. }
  80. /**
  81. * @return the _item
  82. */
  83. public L2ItemInstance getItem()
  84. {
  85. return _item;
  86. }
  87. /**
  88. * @return the acting player.
  89. */
  90. public L2PcInstance getPlayer()
  91. {
  92. return _character == null ? null : _character.getActingPlayer();
  93. }
  94. /**
  95. * @return the _shield
  96. */
  97. public byte getShield()
  98. {
  99. return _shield;
  100. }
  101. /**
  102. * @return the _skill
  103. */
  104. public L2Skill getSkill()
  105. {
  106. return _skill;
  107. }
  108. /**
  109. * @return the _target
  110. */
  111. public L2Character getTarget()
  112. {
  113. return _target;
  114. }
  115. /**
  116. * @return the _value
  117. */
  118. public double getValue()
  119. {
  120. return _value;
  121. }
  122. /**
  123. * @return the _blessedSpiritShot
  124. */
  125. public boolean isBlessedSpiritShot()
  126. {
  127. return _blessedSpiritShot;
  128. }
  129. /**
  130. * @return the _skillMastery
  131. */
  132. public boolean isSkillMastery()
  133. {
  134. return _skillMastery;
  135. }
  136. /**
  137. * @return the _soulShot
  138. */
  139. public boolean isSoulShot()
  140. {
  141. return _soulShot;
  142. }
  143. /**
  144. * @return the _spiritShot
  145. */
  146. public boolean isSpiritShot()
  147. {
  148. return _spiritShot;
  149. }
  150. /**
  151. * @param baseValue the _baseValue to set
  152. */
  153. public void setBaseValue(double baseValue)
  154. {
  155. _baseValue = baseValue;
  156. }
  157. /**
  158. * @param blessedSpiritShot the _blessedSpiritShot to set
  159. */
  160. public void setBlessedSpiritShot(boolean blessedSpiritShot)
  161. {
  162. _blessedSpiritShot = blessedSpiritShot;
  163. }
  164. /**
  165. * @param character the _character to set
  166. */
  167. public void setCharacter(L2Character character)
  168. {
  169. _character = character;
  170. }
  171. /**
  172. * @param cubic the _cubic to set
  173. */
  174. public void setCubic(L2CubicInstance cubic)
  175. {
  176. _cubic = cubic;
  177. }
  178. /**
  179. * @param effect the _effect to set
  180. */
  181. public void setEffect(L2Effect effect)
  182. {
  183. _effect = effect;
  184. }
  185. /**
  186. * @param item the _item to set
  187. */
  188. public void setItem(L2ItemInstance item)
  189. {
  190. _item = item;
  191. }
  192. /**
  193. * @param shield the _shield to set
  194. */
  195. public void setShield(byte shield)
  196. {
  197. _shield = shield;
  198. }
  199. /**
  200. * @param skill the _skill to set
  201. */
  202. public void setSkill(L2Skill skill)
  203. {
  204. _skill = skill;
  205. }
  206. /**
  207. * @param skillMastery the _skillMastery to set
  208. */
  209. public void setSkillMastery(boolean skillMastery)
  210. {
  211. _skillMastery = skillMastery;
  212. }
  213. /**
  214. * @param soulShot the _soulShot to set
  215. */
  216. public void setSoulShot(boolean soulShot)
  217. {
  218. _soulShot = soulShot;
  219. }
  220. /**
  221. * @param spiritShot the _spiritShot to set
  222. */
  223. public void setSpiritShot(boolean spiritShot)
  224. {
  225. _spiritShot = spiritShot;
  226. }
  227. /**
  228. * @param target the _target to set
  229. */
  230. public void setTarget(L2Character target)
  231. {
  232. _target = target;
  233. }
  234. /**
  235. * @param value the _value to set
  236. */
  237. public void setValue(double value)
  238. {
  239. _value = value;
  240. }
  241. public void addValue(double value)
  242. {
  243. _value += value;
  244. }
  245. public void subValue(double value)
  246. {
  247. _value -= value;
  248. }
  249. public void mulValue(double value)
  250. {
  251. _value *= value;
  252. }
  253. public void divValue(double value)
  254. {
  255. _value /= value;
  256. }
  257. }