Ejemplo n.º 1
0
        protected override void InternalOnAddedToBattle(EntityParam param)
        {
            base.InternalOnAddedToBattle(param);

            this.fsm.Start();
            this.ChangeState(FSMStateType.Idle);
        }
Ejemplo n.º 2
0
        protected override void InternalOnAddedToBattle(EntityParam param)
        {
            base.InternalOnAddedToBattle(param);

            this.property.Equal(Attr.Team, param.team);
            this.ApplyLevel(0);

            this._regenTime = 0f;
            this._numSkills = this._data.skills.Length;
            for (int i = 0; i < this._numSkills; i++)
            {
                Skill skill = this.skills[i];
                skill.OnCreated(this._data.skills[i], this.rid);
                skill.OnAttrChanged += this.OnSkillAttrChanged;
                if (skill.isCommon)
                {
                    skill.Upgrade();                    //普攻默认等级1
                    this.commonSkill = skill;
                }
            }

            this.fsm.Start();
            SyncEventHelper.ChangeState(this.rid, FSMStateType.Idle);
            this.ChangeState(FSMStateType.Idle);
            this.ActivePassiveBuffs();
        }
Ejemplo n.º 3
0
        internal void OnAddedToBattle(EntityParam param)
        {
            SyncEventHelper.SpawnEntity(this.GetType().Name, param);
            this._rid  = param.rid;
            this._data = ModelFactory.GetEntityData(Utils.GetIDFromRID(this._rid));
            this.property.Init(this._data);
            this.property.Equal(Attr.Position, param.position);
            this.property.Equal(Attr.Direction, param.direction);
            this.size          = this._data.size * this.property.scale;
            this.bornPosition  = param.position;
            this.bornDirection = param.direction;
            AIData[] aiDatas = this._data.aiDatas;
            if (aiDatas != null)
            {
                int count = aiDatas.Length;
                for (int i = 0; i < count; i++)
                {
                    this.CreateAIEvaluator(aiDatas[i]);
                }
            }

            this.InternalOnAddedToBattle(param);

            SyncEventHelper.EntityAttrInitialized(this.rid);

            if (!string.IsNullOrEmpty(this._data.script))
            {
                this._script = new Script(this, this.battle.luaEnv, this._data.script);
                this._script.Call(Script.S_ON_ENTITY_ADDED_TO_BATTLE);
            }
        }
Ejemplo n.º 4
0
        protected override void InternalOnAddedToBattle(EntityParam param)
        {
            base.InternalOnAddedToBattle(param);

            Hashtable def = Defs.GetEntity(this.id);

            this.detectRange = def.GetFloat("detect_range");
            this.angleSpeed  = def.GetFloat("angle_speed");
            this.angleSpeed2 = def.GetFloat("angle_speed2");
            this.dashDelay   = def.GetFloat("dash_delay");
            this.dashDelay2  = def.GetFloat("dash_delay2");
        }
Ejemplo n.º 5
0
 protected virtual void InternalOnAddedToBattle(EntityParam param)
 {
 }