예제 #1
0
        private void Startup()
        {
            if (!mInitialized)
            {
                mInitialized = true;
                mEnergy      = RequireComponent <ShipEnergyBlock>();

                mRace = RequireComponent <RaceableObject>();
                mShip = GetComponent <BaseShip>();

                var character   = GetComponent <CharacterObject>();
                var dropManager = DropManager.Get(nebulaObject.world.Resource());

                var player = GetComponent <MmoActor>();
                if (player != null)
                {
                }
                else
                {
                    InitializeAsBot();
                }

                mPlayer = GetComponent <MmoActor>();

                //log.Info("ShipWeapon.Start() completed");
            }
        }
예제 #2
0
        public override void Start()
        {
            base.Start();
            mShip    = RequireComponent <BaseShip>();
            mBonuses = RequireComponent <PlayerBonuses>();

            if (GetComponent <PlayerLoaderObject>())
            {
                log.Info("load before destructable");
                GetComponent <PlayerLoaderObject>().Load();
            }

            float initHealth = maximumHealth;

            if (initHealth <= 0.0f)
            {
                initHealth = 1000000;
            }
            //log.InfoFormat("Set health at start to {0}", initHealth);
            ForceSetHealth(initHealth);
            mpcHPRegenNonCombatPerSec = nebulaObject.resource.ServerInputs.GetValue <float>("hp_regen_non_combat");
            player          = GetComponent <MmoActor>();
            mTarget         = GetComponent <PlayerTarget>();
            mSkills         = GetComponent <PlayerSkills>();
            mPassiveBonuses = GetComponent <PassiveBonusesComponent>();
            //mEventedObject = GetComponent<EventedObject>();
            m_Message = GetComponent <MmoMessageComponent>();
        }
예제 #3
0
        //private Dictionary<string, float> energyBuffs;

        public override void Start()
        {
            mShip      = RequireComponent <BaseShip>();
            mAI        = GetComponent <AIState>();
            mPlayer    = GetComponent <MmoActor>();
            mDamagable = GetComponent <ShipBasedDamagableObject>();
            mBonuses   = GetComponent <PlayerBonuses>();
            m_Mmo      = GetComponent <MmoMessageComponent>();

            //energyBuffs = new Dictionary<string, float>();

            mEnergyCostPerShiftMoving = nebulaObject.world.Resource().ServerInputs.GetValue <float>("accelerated_motion_energy_cost");
            mMaxEnergyFromResource    = resource.ServerInputs.GetValue <float>("max_energy");
            mEnergyRestoration        = resource.ServerInputs.GetValue <float>("energy_restoration");
            //log.InfoFormat("MAX EENRGY FROM RESOURCE: {0}, ENERGY RESTORATION: {1}", mMaxEnergyFromResource, mEnergyRestoration);
            mPassiveBonuses = GetComponent <PassiveBonusesComponent>();

            m_CurrentEnergy = maximumEnergy;
        }
예제 #4
0
        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;
        }
예제 #5
0
 public override void Start()
 {
     m_SpeedDetail.Reset();
     m_Ship    = GetComponent <BaseShip>();
     m_Bonuses = GetComponent <PlayerBonuses>();
 }
예제 #6
0
        //private float ApplyResistPassiveBonus(float inputResist) {
        //    if(nebulaObject.IsPlayer()) {
        //        if(mPassiveBonuses != null && mPassiveBonuses.resistTier > 0 ) {
        //            return Mathf.Clamp01(inputResist + mPassiveBonuses.resistBonus);
        //        }
        //    }
        //    return inputResist;
        //}

        public override InputDamage ReceiveDamage(InputDamage inputDamage)
        {
            //firs call base behaviour
            inputDamage = base.ReceiveDamage(inputDamage);

            if (!nebulaObject)
            {
                inputDamage.ClearAllDamages();
                //inputDamage.SetDamage(0.0f);
                return(inputDamage);
            }

            nebulaObject.SendMessage(ComponentMessages.InCombat);

            if (ignoreDamageAtStart || god)
            {
                //if (GetComponent<MmoActor>()) {
                //    log.Info("player damage ignored");
                //}
                //return 0f;
                inputDamage.ClearAllDamages();
                //inputDamage.SetDamage(0.0f);
                return(inputDamage);
            }
            //if(god) {
            //    //log.Info("ShipBasedDamagableObject is GOD, return 0 damage");
            //    return 0f;
            //}

            if (mShip == null)
            {
                mShip = GetComponent <BaseShip>();
            }
            float resist       = 0f;
            float acidResist   = 0.0f;
            float laserResist  = 0.0f;
            float rocketResist = 0.0f;

            if (mShip != null)
            {
                resist       = mShip.commonResist;
                acidResist   = mShip.acidResist;
                laserResist  = mShip.laserResist;
                rocketResist = mShip.rocketResist;
            }
            //resist = ApplyResistPassiveBonus(resist);

            inputDamage.Mult(1.0f - Mathf.Clamp01(resist));

            inputDamage.Mult(WeaponBaseType.Acid, 1.0f - Mathf.Clamp01(acidResist));
            inputDamage.Mult(WeaponBaseType.Laser, 1.0f - Mathf.Clamp01(laserResist));
            inputDamage.Mult(WeaponBaseType.Rocket, 1.0f - Mathf.Clamp01(rocketResist));

            //inputDamage.SetDamage(inputDamage.damage * (1.0f - Mathf.Clamp01(resist)));
            AbsorbDamage(inputDamage);
            //inputDamage.CopyValues(AbsorbDamage(inputDamage.damage));

            if (!god)
            {
                if (mBonuses)
                {
                    if (mBonuses.isImmuneToDamage)
                    {
                        inputDamage.ClearAllDamages();
                        //inputDamage.SetDamage(0f);
                    }
                }

                if (nebulaObject.IsPlayer())
                {
                    mTarget.MoveDamageToSubscriber(inputDamage);
                }
                SubHealth(inputDamage.totalDamage);
            }

            if (inputDamage.hasDamager)
            {
                AddDamager(
                    inputDamage.sourceId,
                    inputDamage.sourceType,
                    inputDamage.totalDamage,
                    (byte)inputDamage.workshop,
                    inputDamage.level,
                    (byte)inputDamage.race,
                    inputDamage.source);
            }

            //if(mEventedObject != null && inputDamage.hasDamager) {
            //    mEventedObject.ReceiveDamage(new DamageInfo(inputDamage.sourceId, inputDamage.sourceType, inputDamage.damage, (byte)inputDamage.workshop, inputDamage.level, (byte)inputDamage.race));
            //}

            if (health <= 0f)
            {
                if (NotRespawnBySkill())
                {
                    SetWasKilled(true);
                }
                else
                {
                    if (nebulaObject.Type == (byte)ItemType.Avatar)
                    {
                        if (m_Message)
                        {
                            m_Message.ResurrectBySkillEffect();
                        }
                    }
                }
            }
            return(inputDamage);
        }