public void ModifyDamage(DamagableObject target, InputDamage inputDamage) { if (nebulaObject.Type == (byte)ItemType.Avatar) { if (HasSkill(m43AID)) { var skill = GetSkillById(m43AID); if (skill.isOn) { var m43a = skill.GetExecutor() as Skill_0000043A; if (target.health < target.maximumHealth * m43a.hpPc) { if (false == Mathf.Approximately(m43a.dmgMult, 0f)) { //log.InfoFormat("modify damage on {0}% with skill 43A", m43a.dmgMult); inputDamage.Mult(m43a.dmgMult); //return inputDamage; } } } } } //return inputDamage; }
public override void Start() { base.Start(); //cache raceable component mRaceable = GetComponent <RaceableObject>(); mCharacter = GetComponent <CharacterObject>(); mDamagable = GetComponent <DamagableObject>(); mConstructionTimer = CONSTRUCTION_INTERVAL; SetUnderConstruction(true); }
public override void Start() { this.fsm = new BaseFSM <PirateStationState>(); this.fsm.AddState(new FSMState <PirateStationState>(PirateStationState.Idle, () => { }, () => { }, () => { })); this.fsm.AddState(new FSMState <PirateStationState>(PirateStationState.Dead, () => { }, () => { }, () => { })); this.fsm.ForceState(PirateStationState.Idle, true); mDamagable = RequireComponent <DamagableObject>(); mMessage = RequireComponent <MmoMessageComponent>(); Move(nebulaObject.transform.position, nebulaObject.transform.rotation); (nebulaObject as Item).UpdateInterestManagement(); }
private bool ReflectDamage(DamagableObject targetDamagable, ref WeaponHitInfo hit, InputDamage inputDamage) { bool reflected = targetDamagable.TryReflectDamage(); if (reflected) { if (hit.normal) { DamageParams damageParams = new DamageParams(); damageParams.SetReflrected(true); InputDamage inpDamage = new InputDamage(targetDamagable.nebulaObject, inputDamage.CreateCopy(), damageParams); cachedDamagable.ReceiveDamage(inpDamage); } } return(reflected); }
public float ModifyCritChance(DamagableObject target, float inputCritChance) { if (HasSkill(m45CID)) { var skill = GetSkillById(m45CID); if (skill.isOn) { float healpPc = skill.GetFloatInput("hp_pc"); if (target.health < healpPc * target.maximumHealth) { float critChanceMult = skill.GetFloatInput("crit_chance_mult"); return(inputCritChance * critChanceMult); } } } return(inputCritChance); }
private void ApplyDamage(ref WeaponHitInfo hit, DamagableObject target, float damageMult, bool useDamageMultSelfAsDamage, InputDamage inputDamage) { inputDamage.Mult(damageMult * Rand.NormalNumber(0.8f, 1.2f)); if (useDamageMultSelfAsDamage) { WeaponDamage dmg = new WeaponDamage(inputDamage.weaponBaseType, 0, 0, 0); dmg.SetBaseTypeDamage(damageMult); inputDamage.CopyValues(dmg); } if (cachedSkills) { cachedSkills.ModifyDamage(target, inputDamage); } int level = 1; byte workshop = (byte)Workshop.Arlen; byte race = (byte)Race.None; level = cachedCharacter.level; workshop = cachedCharacter.workshop; RaceableObject raceable = nebulaObject.Raceable(); if (raceable) { race = raceable.race; } var copy = inputDamage.CreateCopy(); if (false == ReflectDamage(target, ref hit, inputDamage)) { target.ReceiveDamage(inputDamage); StartDamageDron(target, inputDamage.CreateCopy(), workshop, level, race); } hit.SetRemainTargetHp(target.health); if (m_Achievments != null) { m_Achievments.OnMakeDamage(copy); } }
private void StartHealDron(DamagableObject targetObject, float healValue) { if (nebulaObject.IsPlayer()) { if (mPassiveBonuses != null && mPassiveBonuses.healDronTier > 0) { float dronHealValue = healValue * mPassiveBonuses.healDronBonus; targetObject.RestoreHealth(nebulaObject, dronHealValue); Hashtable dronInfo = new Hashtable { { (int)SPC.Target, targetObject.nebulaObject.Id }, { (int)SPC.TargetType, targetObject.nebulaObject.Type }, { (int)SPC.HealValue, dronHealValue } }; mMessage.SendHealDron(dronInfo); } } }
public override void Start() { base.Start(); mUpdateImmunityTimer = mUpdateImmunityInterval; mDamagable = GetComponent <DamagableObject>(); mRaceable = GetComponent <RaceableObject>(); mConstructionTimer = CONSTRUCTION_INTERVAL; SetUnderConstruction(true); var world = nebulaObject.world as MmoWorld; if ((byte)world.ownedRace != mRaceable.race) { log.InfoFormat("change world race on outpost start [red]"); world.SetCurrentRace((Race)mRaceable.race); } }
public override void Start() { if (!m_StartCalled) { m_StartCalled = true; mPlayerShip = GetComponent <BaseShip>(); bonuses = GetComponent <PlayerBonuses>(); mDamagable = GetComponent <DamagableObject>(); message = GetComponent <MmoMessageComponent>(); energy = GetComponent <ShipEnergyBlock>(); m439ID = SkillExecutor.SkilIDFromHexString("00000439"); m43AID = SkillExecutor.SkilIDFromHexString("0000043A"); m451ID = SkillExecutor.SkilIDFromHexString("00000451"); m456ID = SkillExecutor.SkilIDFromHexString("00000456"); m45CID = SkillExecutor.SkilIDFromHexString("0000045C"); } SetBlockedProperty(false); started = true; }
private void StartDamageDron(DamagableObject targetObject, WeaponDamage inputDamage, byte workshop, int level, byte race) { if (nebulaObject.IsPlayer()) { if (mPassiveBonuses != null && mPassiveBonuses.damageDronTier > 0) { WeaponDamage dronDamage = new WeaponDamage(); dronDamage.SetFromDamage(inputDamage); dronDamage.Mult(mPassiveBonuses.damageDronBonus); InputDamage inpDamage = new InputDamage(nebulaObject, dronDamage); targetObject.ReceiveDamage(inpDamage); Hashtable dronInfo = new Hashtable { { (int)SPC.Target, targetObject.nebulaObject.Id }, { (int)SPC.TargetType, targetObject.nebulaObject.Type }, { (int)SPC.Damage, dronDamage.totalDamage } }; mMessage.SendDamageDron(dronInfo); } } }
public TimedDamage(DamagableObject target) { mTarget = target; }
public override void Start() { base.Start(); mDamagable = GetComponent <DamagableObject>(); }