public OpenSpaceInfo(int indexId, CharacterPrototype proto) : base(indexId, proto) { this.towerData = J_Tower.GetData(proto.charId); stateMachine = new StateMachine(); openSpaceConstructing = new OpenSpaceConstructing(this); }
public CharacterInstance(CharacterPrototype prototype) { Prototype = prototype; Attack = prototype.Attack; AttackSpeed = prototype.AttackSpeed; Hp = prototype.Hp; RefreshTime = prototype.RefreshTime; }
public void InitAttr(CharacterPrototype _charInfo) { charName = _charInfo.charName; SetAttr(CharAttr.AttackSpeed, _charInfo.GetAttr(CharAttr.AttackSpeed)); SetAttr(CharAttr.AttackSpeedPer, _charInfo.GetAttr(CharAttr.AttackSpeedPer)); SetAttr(CharAttr.AttackDamage, _charInfo.GetAttr(CharAttr.AttackDamage)); SetAttr(CharAttr.AttackDamagePer, _charInfo.GetAttr(CharAttr.AttackDamagePer)); }
public AttackTowerInfo(int indexId, CharacterPrototype proto) : base(indexId, proto) { towerStateMachine = new StateMachine(); towerAtk = new TowerAtk(this); towerIdle = new TowerIdle(this); towerConstructing = new TowerConstructing(this); attackSkill = SkillManager.getInstance().AddSkill(this.towerData._attackId, this); }
public TowerInfo(int indexId, CharacterPrototype proto) { this.Id = indexId; this.charId = proto.charId; this.towerData = J_Tower.GetData(charId); this.towerBase = towerData._towerBase; this.shooter = towerData._Shooter; this.towerType = towerData._towerType; InitAttr(proto); }
public SoliderInfo(int soliderIndexId, CharacterPrototype charInfo) { charProto = charInfo; Id = soliderIndexId; charId = charInfo.charId; InitAttr(charInfo); InitStatusMachine(); attackSkill = SkillManager.getInstance().AddSkill(1, this); charInfo.eventDispatcher.Register("ChangeProtoAttr", ChangeProtoAttr); }
//复制原型类中的数据 public MonsterInfo(int creatureIndexId, CharacterPrototype charInfo, PathInfo _pathInfo) { Id = creatureIndexId; charId = charInfo.charId; InitAttr(charInfo); InitStatusMachine(); attackSkill = SkillManager.getInstance().AddSkill(1, this); pathInfo = _pathInfo; curPathNum = 0; position = pathInfo.GetPoint(curPathNum); charInfo.eventDispatcher.Register("ChangeProtoAttr", ChangeProtoAttr); }
public BarrackTowerInfo(int indexId, CharacterPrototype proto) : base(indexId, proto) { soliderId = towerData._soliderId; towerStateMachine = new StateMachine(); barrackStart = new BarrackStart(this); barrackIdle = new BarrackIdle(this); barrackConstructing = new BarrackConstructing(this); soliderDict = new Dictionary <int, SoliderInfo>(); soliderPos = new Vector3[3]; startTime = AnimationCache.getInstance().getAnimation(this.towerBase).getMeshAnimation("start").getAnimTime(); }
public void InitAttr(CharacterPrototype _charInfo) { charName = _charInfo.charName; SetAttr(CharAttr.HpMax, _charInfo.GetAttr(CharAttr.HpMax)); SetAttr(CharAttr.HpMaxPer, _charInfo.GetAttr(CharAttr.HpMaxPer)); SetAttr(CharAttr.Hp, _charInfo.GetAttr(CharAttr.Hp)); SetAttr(CharAttr.HpPer, _charInfo.GetAttr(CharAttr.HpPer)); SetAttr(CharAttr.AttackSpeed, _charInfo.GetAttr(CharAttr.AttackSpeed)); SetAttr(CharAttr.AttackSpeedPer, _charInfo.GetAttr(CharAttr.AttackSpeedPer)); SetAttr(CharAttr.AttackDamage, _charInfo.GetAttr(CharAttr.AttackDamage)); SetAttr(CharAttr.AttackDamagePer, _charInfo.GetAttr(CharAttr.AttackDamagePer)); SetAttr(CharAttr.ArmorType, _charInfo.GetAttr(CharAttr.ArmorType)); SetAttr(CharAttr.Speed, _charInfo.GetAttr(CharAttr.Speed)); SetAttr(CharAttr.SpeedPer, _charInfo.GetAttr(CharAttr.SpeedPer)); }
public SoliderInfo AddSolider(int soliderId) { soliderIndexId += 1; if (!soliderPrototypes.ContainsKey(soliderId)) { soliderPrototypes.Add(soliderId, new CharacterPrototype(soliderId, CharacterType.Solider)); } CharacterPrototype proto = soliderPrototypes[soliderId]; SoliderInfo charInfo = proto.CloneSolider(soliderIndexId); //soliders.Add(soliderIndexId, charInfo); //标记为“添加” charInfo.SetDirtySign(false); soliderTempList.Add(soliderIndexId, charInfo); this.eventDispatcher.Broadcast("AddSolider", charInfo); return(charInfo); }
public MonsterInfo AddMonster(int monsterId, PathInfo pathInfo) { monsterIndexId += 1; if (!monsterPrototypes.ContainsKey(monsterId)) { monsterPrototypes.Add(monsterId, new CharacterPrototype(monsterId, CharacterType.Monster)); } CharacterPrototype proto = monsterPrototypes[monsterId]; MonsterInfo charInfo = proto.CloneMonster(monsterIndexId, pathInfo); //monsters.Add(monsterIndexId, charInfo); //标记为“添加” charInfo.SetDirtySign(false); monsterTempList.Add(monsterIndexId, charInfo); this.eventDispatcher.Broadcast("AddMonster", charInfo); return(charInfo); }
//添加防御塔 public TowerInfo AddTower(int towerId) { towerIndexId++; if (!towerPrototypes.ContainsKey(towerId)) { towerPrototypes.Add(towerId, new CharacterPrototype(towerId, CharacterType.Tower)); } CharacterPrototype proto = towerPrototypes[towerId]; TowerInfo towerInfo = proto.CloneTower(towerIndexId); //towers.Add(towerIndexId, towerInfo); //标记为“添加” towerInfo.SetDirtySign(false); towerTempList.Add(towerIndexId, towerInfo); this.eventDispatcher.Broadcast("AddTower", towerInfo); return(towerInfo); }