123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- /*
- * Copyright (C) 2004-2013 L2J Server
- *
- * This file is part of L2J Server.
- *
- * L2J Server is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * L2J Server is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- package com.l2jserver.gameserver.model.stats;
- import com.l2jserver.gameserver.model.actor.L2Character;
- import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
- import com.l2jserver.gameserver.model.skills.L2Skill;
- /**
- * An Env object is just a class to pass parameters to a calculator such as L2PcInstance, L2ItemInstance, Initial value.
- * @author Zoey76
- */
- public final class Env
- {
- private double _baseValue;
- private boolean _blessedSpiritShot = false;
- private L2Character _character;
- private L2CubicInstance _cubic;
- private L2ItemInstance _item;
- private byte _shield = 0;
- private L2Skill _skill;
- private boolean _skillMastery = false;
- private boolean _soulShot = false;
- private boolean _spiritShot = false;
- private L2Character _target;
- private double _value;
-
- public Env()
- {
- }
-
- public Env(byte shield, boolean soulShot, boolean spiritShot, boolean blessedSpiritShot)
- {
- _shield = shield;
- _soulShot = soulShot;
- _spiritShot = spiritShot;
- _blessedSpiritShot = blessedSpiritShot;
- }
-
- /**
- * @return the _baseValue
- */
- public double getBaseValue()
- {
- return _baseValue;
- }
-
- /**
- * @return the _character
- */
- public L2Character getCharacter()
- {
- return _character;
- }
-
- /**
- * @return the _cubic
- */
- public L2CubicInstance getCubic()
- {
- return _cubic;
- }
-
- /**
- * @return the _item
- */
- public L2ItemInstance getItem()
- {
- return _item;
- }
-
- /**
- * @return the acting player.
- */
- public L2PcInstance getPlayer()
- {
- return _character == null ? null : _character.getActingPlayer();
- }
-
- /**
- * @return the _shield
- */
- public byte getShield()
- {
- return _shield;
- }
-
- /**
- * @return the _skill
- */
- public L2Skill getSkill()
- {
- return _skill;
- }
-
- /**
- * @return the _target
- */
- public L2Character getTarget()
- {
- return _target;
- }
-
- /**
- * @return the _value
- */
- public double getValue()
- {
- return _value;
- }
-
- /**
- * @return the _blessedSpiritShot
- */
- public boolean isBlessedSpiritShot()
- {
- return _blessedSpiritShot;
- }
-
- /**
- * @return the _skillMastery
- */
- public boolean isSkillMastery()
- {
- return _skillMastery;
- }
-
- /**
- * @return the _soulShot
- */
- public boolean isSoulShot()
- {
- return _soulShot;
- }
-
- /**
- * @return the _spiritShot
- */
- public boolean isSpiritShot()
- {
- return _spiritShot;
- }
-
- /**
- * @param baseValue the _baseValue to set
- */
- public void setBaseValue(double baseValue)
- {
- _baseValue = baseValue;
- }
-
- /**
- * @param blessedSpiritShot the _blessedSpiritShot to set
- */
- public void setBlessedSpiritShot(boolean blessedSpiritShot)
- {
- _blessedSpiritShot = blessedSpiritShot;
- }
-
- /**
- * @param character the _character to set
- */
- public void setCharacter(L2Character character)
- {
- _character = character;
- }
-
- /**
- * @param cubic the _cubic to set
- */
- public void setCubic(L2CubicInstance cubic)
- {
- _cubic = cubic;
- }
-
- /**
- * @param item the _item to set
- */
- public void setItem(L2ItemInstance item)
- {
- _item = item;
- }
-
- /**
- * @param shield the _shield to set
- */
- public void setShield(byte shield)
- {
- _shield = shield;
- }
-
- /**
- * @param skill the _skill to set
- */
- public void setSkill(L2Skill skill)
- {
- _skill = skill;
- }
-
- /**
- * @param skillMastery the _skillMastery to set
- */
- public void setSkillMastery(boolean skillMastery)
- {
- _skillMastery = skillMastery;
- }
-
- /**
- * @param soulShot the _soulShot to set
- */
- public void setSoulShot(boolean soulShot)
- {
- _soulShot = soulShot;
- }
-
- /**
- * @param spiritShot the _spiritShot to set
- */
- public void setSpiritShot(boolean spiritShot)
- {
- _spiritShot = spiritShot;
- }
-
- /**
- * @param target the _target to set
- */
- public void setTarget(L2Character target)
- {
- _target = target;
- }
-
- /**
- * @param value the _value to set
- */
- public void setValue(double value)
- {
- _value = value;
- }
-
- public void addValue(double value)
- {
- _value += value;
- }
-
- public void subValue(double value)
- {
- _value -= value;
- }
-
- public void mulValue(double value)
- {
- _value *= value;
- }
-
- public void divValue(double value)
- {
- _value /= value;
- }
- }
|