コード例 #1
0
 public override void Start()
 {
     base.Start();
     mBonuses = GetComponent <PlayerBonuses>();
     ForceSetHealth(maximumHealth);
     mBot = GetComponent <BotObject>();
     //mEventedObject = GetComponent<EventedObject>();
 }
コード例 #2
0
 public override void Start()
 {
     cachedTarget    = RequireComponent <PlayerTarget>();
     cachedCharacter = RequireComponent <CharacterObject>();
     cachedBonuses   = GetComponent <PlayerBonuses>();
     cachedSkills    = GetComponent <PlayerSkills>();
     cachedDamagable = GetComponent <DamagableObject>();
     mPassiveBonuses = GetComponent <PassiveBonusesComponent>();
     mMessage        = GetComponent <MmoMessageComponent>();
     m_Achievments   = GetComponent <AchievmentComponent>();
     m_CachedBot     = GetComponent <BotObject>();
 }
コード例 #3
0
 public override void Start()
 {
     //damagers = new Dictionary<string, DamageInfo>();
     props.SetProperty((byte)PS.IgnoreDamage, ignoreDamage);
     props.SetProperty((byte)PS.IgnoreDamageTimer, mIgnoreDamageTimer);
     mIgnoreDamageTimer = ignoreDamageInterval;
     mBonuses           = GetComponent <PlayerBonuses>();
     timedDamage        = new TimedDamage(this);
     m_Skills           = GetComponent <PlayerSkills>();
     m_Achievments      = GetComponent <AchievmentComponent>();
     m_Bot       = GetComponent <BotObject>();
     m_Mmo       = GetComponent <MmoMessageComponent>();
     m_Character = GetComponent <CharacterObject>();
 }
コード例 #4
0
        /// <summary>
        /// When enemy death we are send chat message to all player about this event if
        /// 1) enemy is orange NPC
        /// 2) i kill other player
        /// </summary>
        /// <param name="enemy">Enemy who was killed</param>
        public void OnEnemyDeath(NebulaObject enemy)
        {
            try {
                //log.InfoFormat(string.Format("PlayerCharacter:OnEnemyDeath()->{0}", enemy.Id));

                switch (enemy.getItemType())
                {
                case ItemType.Bot: {
                    BotObject botObject = enemy.GetComponent <BotObject>();
                    if (botObject != null)
                    {
                        switch (botObject.getSubType())
                        {
                        case BotItemSubType.Drill:
                        case BotItemSubType.Outpost:
                        case BotItemSubType.MainOutpost: {
                            mPlayer.application.updater.SendChatBroadcast(m_ChatComposer.GetKillStandardNPCMessage(this, enemy));
                            break;
                        }

                        case BotItemSubType.StandardCombatNpc: {
                            ShipWeapon enemyWeapon = enemy.GetComponent <ShipWeapon>();
                            BotShip    enemyShip   = enemy.GetComponent <BotShip>();

                            if (enemyWeapon != null && enemyShip != null)
                            {
                                if (enemyWeapon.weaponDifficulty == Difficulty.boss || enemyWeapon.weaponDifficulty == Difficulty.boss2 ||
                                    enemyShip.difficulty == Difficulty.boss || enemyShip.difficulty == Difficulty.boss2)
                                {
                                    mPlayer.application.updater.SendChatBroadcast(m_ChatComposer.GetKillStandardNPCMessage(this, enemy));
                                }
                            }
                        }
                        break;
                        }
                    }
                }
                break;

                case ItemType.Avatar: {
                    mPlayer.application.updater.SendChatBroadcast(m_ChatComposer.GetKillOtherPlayerMessage(this, enemy));
                }
                break;
                }
            } catch (System.Exception exception) {
                log.InfoFormat("PlayerCharacter.OnEnemyDeath() exception: {0}", exception.Message);
                log.InfoFormat(exception.StackTrace);
            }
        }
コード例 #5
0
 /// <summary>
 /// Sended to my object fron enemy, when my object first start attacking enemy
 /// </summary>
 /// <param name="enemy">Attacking object</param>
 public void OnStartAttack(NebulaObject enemy)
 {
     switch (enemy.getItemType())
     {
     case ItemType.Bot: {
         BotObject botObject = enemy.GetComponent <BotObject>();
         if (botObject != null)
         {
             switch (botObject.getSubType())
             {
             case BotItemSubType.Drill:
             case BotItemSubType.Outpost:
             case BotItemSubType.MainOutpost:
                 mPlayer.application.updater.SendChatBroadcast(m_ChatComposer.GetStartAttackMessage(this, enemy));
                 break;
             }
         }
     }
     break;
     }
 }