public void SetHp(Operate_Type opType, int tVal) { int key = CharacterProperty.Key; m_Hp = (int)CharacterProperty.UpdateAttr(m_Hp, m_ActualProperty.HpMax * key, opType, tVal); m_PropertyChanged = true; }
public void SetStateFlag(Operate_Type opType, CharacterState_Type mask) { if (opType == Operate_Type.OT_AddBit) { m_StateFlag |= (int)mask; } else if (opType == Operate_Type.OT_RemoveBit) { m_StateFlag &= ~((int)mask); } m_PropertyChanged = true; }
public static float UpdateAttr(float val, float maxVal, Operate_Type opType, float tVal) { float ret = val; if (opType == Operate_Type.OT_PercentMax) { float t = maxVal * (tVal / 100.0f); ret = t; } else { ret = UpdateAttr(val, opType, tVal); } return(ret); }
protected void SetGfxStateFlag(GameObject obj, Operate_Type opType, GfxCharacterState_Type mask) { SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(obj); if (null != shareInfo) { if (opType == Operate_Type.OT_AddBit) { shareInfo.GfxStateFlag |= (int)mask; } else if (opType == Operate_Type.OT_RemoveBit) { shareInfo.GfxStateFlag &= ~((int)mask); } } }
public void SetEnergy(Operate_Type opType, int tVal) { int key = CharacterProperty.Key; int result = (int)CharacterProperty.UpdateAttr(m_Energy, m_ActualProperty.EnergyMax * key, opType, tVal); if (result > m_ActualProperty.EnergyMax * key) { result = m_ActualProperty.EnergyMax * key; } else if (result < 0) { result = 0; } m_Energy = result; m_PropertyChanged = true; }
public void SetShield(Operate_Type opType, int tVal) { const int c_MaxShield = 500; int key = CharacterProperty.Key; int result = (int)CharacterProperty.UpdateAttr(m_Shield, c_MaxShield * key, opType, tVal); if (result > c_MaxShield * key) { result = c_MaxShield * key; } else if (result < 0) { result = 0; } m_Shield = result; m_PropertyChanged = true; }
//------------------------------------------------------------------------ //指定属性枚举值设置属性值,属性值参数为float类型,内部根据属性类型自行转换 //------------------------------------------------------------------------ public void SetAttributeByType(AttrbuteEnum attrType, Operate_Type opType, float tVal) { switch (attrType) { case AttrbuteEnum.Actual_Strength: SetStrength(opType, (int)tVal); break; case AttrbuteEnum.Actual_StrengthRate: SetStrengthRate(opType, (int)tVal); break; case AttrbuteEnum.Actual_Intelligence: SetIntelligence(opType, (int)tVal); break; case AttrbuteEnum.Actual_IntelligenceRate: SetIntelligenceRate(opType, (int)tVal); break; case AttrbuteEnum.Actual_Charm: SetCharm(opType, (int)tVal); break; case AttrbuteEnum.Actual_CharmRate: SetCharmRate(opType, (int)tVal); break; case AttrbuteEnum.Actual_Action: SetAction(opType, (int)tVal); break; case AttrbuteEnum.Actual_ActionMax: SetActionMax(opType, (int)tVal); break; case AttrbuteEnum.Actual_Gold: SetGold(opType, (int)tVal); break; default: break; } }
public static float UpdateAttr(float val, Operate_Type opType, float tVal) { float ret = val; if (opType == Operate_Type.OT_Absolute) { ret = tVal; } else if (opType == Operate_Type.OT_Relative) { float t = (ret + tVal); if (t < 0) { t = 0; } ret = t; } else if (opType == Operate_Type.OT_PercentCurrent) { float t = (ret * (tVal / 100.0f)); ret = t; } return(ret); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetEnergyArmor(Operate_Type opType, float tVal) { m_EnergyArmor = UpdateAttr(m_EnergyArmor, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetDefenceBase(Operate_Type opType, int tVal) { m_DefenceBase = (int)UpdateAttr(m_DefenceBase, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetDefenceBase(Operate_Type opType, int tVal) { m_DefenceBase = (int)UpdateAttr(m_DefenceBase, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetArmorPenetration(Operate_Type opType, float tVal) { m_ArmorPenetration = UpdateAttr(m_ArmorPenetration, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetCrgMax(Operate_Type opType, int tVal) { m_CrgMax = (int)UpdateAttr(m_CrgMax, m_CrgMax, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetEnergyCoreRecover(Operate_Type opType, float tVal) { m_EnergyCoreRecover = UpdateAttr(m_EnergyCoreRecover, opType, tVal); }
public static float UpdateAttr(float val, Operate_Type opType, float tVal) { float ret = val; if (opType == Operate_Type.OT_Absolute) { ret = tVal * s_Key; } else if (opType == Operate_Type.OT_Relative) { float t = (ret + tVal * s_Key); if (t < 0) { t = 0; } ret = t; } else if (opType == Operate_Type.OT_PercentCurrent) { float t = (ret * (tVal / 100.0f)); ret = t; } return ret; }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetMoveSpeed(Operate_Type opType, float tVal) { m_MoveSpeed = UpdateAttr(m_MoveSpeed, m_MoveSpeed, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetAttackRange(Operate_Type opType, float tVal) { m_AttackRange = UpdateAttr(m_AttackRange, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetAttackBase(Operate_Type opType, int tVal) { m_AttackBase = (int)UpdateAttr(m_AttackBase, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetRps(Operate_Type opType, float tVal) { m_Rps = UpdateAttr(m_Rps, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetMoveSpeed(Operate_Type opType, float tVal) { m_MoveSpeed = UpdateAttr(m_MoveSpeed, m_MoveSpeed, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetHpMax(Operate_Type opType, int tVal) { m_HpMax = (int)UpdateAttr(m_HpMax, m_HpMax, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetPoisonDamage(Operate_Type opType, float tVal) { m_PoisonDam = UpdateAttr(m_PoisonDam, opType, tVal); }
public static float UpdateAttr(float val, float maxVal, Operate_Type opType, float tVal) { float ret = val; if (opType == Operate_Type.OT_PercentMax) { float t = maxVal * (tVal / 100.0f); ret = t; } else { ret = UpdateAttr(val, opType, tVal); } return ret; }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetPoisonERD(Operate_Type opType, float tVal) { m_PoisonERD = UpdateAttr(m_PoisonERD, opType, tVal); }
public void SetStateFlag(Operate_Type opType, CharacterState_Type mask) { if (opType == Operate_Type.OT_AddBit) { m_StateFlag |= (int)mask; } else if (opType == Operate_Type.OT_RemoveBit) { m_StateFlag &= ~((int)mask); } m_PropertyChanged = true; }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetEnergyCoreMax(Operate_Type opType, int tVal) { m_EnergyCoreMax = (int)UpdateAttr(m_EnergyCoreMax, m_EnergyCoreMax, opType, tVal); }
/** * @brief 弹容量 */ public void SetCrg(Operate_Type opType, int tVal) { m_Crg = (int)UpdateAttr(m_Crg, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetHpRecover(Operate_Type opType, float tVal) { m_HpRecover = UpdateAttr(m_HpRecover, opType, tVal); }
/** * @brief 武器dps */ public void SetWdps(Operate_Type opType, float tVal) { m_Wdps = UpdateAttr(m_Wdps, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetAttackBase(Operate_Type opType, int tVal) { m_AttackBase = (int)UpdateAttr(m_AttackBase, opType, tVal); }
public void SetShield(Operate_Type opType, int tVal) { const int c_MaxShield = 500; int key = CharacterProperty.Key; int result = (int)CharacterProperty.UpdateAttr(m_Shield, c_MaxShield * key, opType, tVal); if (result > c_MaxShield * key) { result = c_MaxShield * key; } else if (result < 0) { result = 0; } m_Shield = result; m_PropertyChanged = true; }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetCriticalPow(Operate_Type opType, float tVal) { m_CriticalPow = UpdateAttr(m_CriticalPow, opType, tVal); }
public void SetHp(Operate_Type opType, int tVal) { int key = CharacterProperty.Key; m_Hp = (int)CharacterProperty.UpdateAttr(m_Hp, m_ActualProperty.HpMax * key, opType, tVal); m_PropertyChanged = true; }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetEnergyIntensity(Operate_Type opType, float tVal) { m_EnergyIntensity = UpdateAttr(m_EnergyIntensity, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetIceERD(Operate_Type opType, float tVal) { m_IceERD = UpdateAttr(m_IceERD, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetAttackRange(Operate_Type opType, float tVal) { m_AttackRange = UpdateAttr(m_AttackRange, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetCriticalPow(Operate_Type opType, float tVal) { m_CriticalPow = UpdateAttr(m_CriticalPow, opType, tVal); }
/** * @brief 换弹甲时间 */ public void SetCht(Operate_Type opType, float tVal) { m_Cht = UpdateAttr(m_Cht, opType, tVal); }
public void SetCriticalFactor(Operate_Type opType, float tVal) { m_CriticalFactor = UpdateAttr(m_CriticalFactor, m_CriticalFactor, opType, tVal); }
/** * @brief 武器伤害浮动 */ public void SetDamRange(Operate_Type opType, float tVal) { m_DamRandom = UpdateAttr(m_DamRandom, opType, tVal); }
public void SetWoodFactor(Operate_Type opType, float tVal) { m_WoodFactor = UpdateAttr(m_WoodFactor, m_WoodFactor, opType, tVal); }
/** * @brief 角色属性修改 * * @param optype 操作类型 * @param val 值 * */ public void SetIceDamage(Operate_Type opType, float tVal) { m_IceDam = UpdateAttr(m_IceDam, opType, tVal); }
public void SetEnergy(Operate_Type opType, int tVal) { int key = CharacterProperty.Key; int result = (int)CharacterProperty.UpdateAttr(m_Energy, m_ActualProperty.EnergyMax * key, opType, tVal); if (result > m_ActualProperty.EnergyMax * key) { result = m_ActualProperty.EnergyMax * key; } else if (result < 0) { result = 0; } m_Energy = result; m_PropertyChanged = true; }