Env.java 5.1 KB

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