} //等级更新 public void UpdateItem(TmEntity entity) { TmSkill inventory = entity.GetComponent <TmSkill>(); TmProperty property = entity.GetComponent <TmProperty>(); TmChangeType changeType = entity.GetComponent <TmChangeType>(); switch (inventory.InfoType) { case (InfoType.Brains): property.Stamina += (int)(inventory.Stamina * (changeType.Level + 1)); property.Brains += (int)(inventory.Brains * (changeType.Level + 1)); break; case (InfoType.Power): property.Stamina += (int)(inventory.Stamina * (changeType.Level + 1)); property.Power += (int)(inventory.Power * (changeType.Level + 1)); break; case (InfoType.Bp): property.Bp += (int)(inventory.Bp * (changeType.Level + 1)); break; case (InfoType.Ap): property.Ap += (int)(inventory.Ap * (changeType.Level + 1)); break; } }
void InitAddProperty(TmEntity entity) { soulerItem = entity.GetComponent <TmProperty>(); property = entity.GetComponent <TmBuffAdd>(); property.MaxHp = (int)(soulerItem.MaxHp * property.MaxHpRate + soulerItem.StaminaRate * property.Stamina); property.Hp = (int)(soulerItem.Hp * property.HpRate); property.Bp = (int)(soulerItem.Bp * property.BpRate + soulerItem.BrainsRate * property.Brains); property.Ap = (int)(soulerItem.Ap * property.ApRate + soulerItem.PowerRate * property.Power); property.Sp = (int)(soulerItem.Sp * property.SpRate); } //更新属性
void PropertyInit(TmEntity entity) { if (entity.GetComponent <TmSouler>() != null && entity.GetComponent <TmProperty>() != null && entity.GetComponent <TmChangeType>() != null) { TmChangeType changeType = entity.GetComponent <TmChangeType>(); TmProperty property = entity.GetComponent <TmProperty>(); if (property.Hp != changeType.changeCount) { InitProperty(entity); changeType.changeCount = property.Hp; } } }
void PropertyInit(TmEntity entity) { if (entity.GetComponent <TmSkill>() != null && entity.GetComponent <TmProperty>() != null && entity.GetComponent <TmChangeType>() != null) { TmSkill skill = entity.GetComponent <TmSkill>(); TmProperty property = entity.GetComponent <TmProperty>(); TmChangeType changeType = entity.GetComponent <TmChangeType>(); if (changeType.Exp != changeType.changeCount) { InitProperty(entity); changeType.changeCount = changeType.Exp; } } }
} //更新属性 void InitPropertyOne(TmEntity soulerItem) { soulerItem.GetComponent <TmProperty>().Stamina = soulerItem.GetComponent <TmSkill>().Stamina *(soulerItem.GetComponent <TmChangeType>().Level + 1); soulerItem.GetComponent <TmProperty>().Brains = soulerItem.GetComponent <TmSkill>().Brains *(soulerItem.GetComponent <TmChangeType>().Level + 1); soulerItem.GetComponent <TmProperty>().Power = soulerItem.GetComponent <TmSkill>().Power *(soulerItem.GetComponent <TmChangeType>().Level + 1); soulerItem.GetComponent <TmProperty>().Agility = soulerItem.GetComponent <TmSkill>().Agility *(soulerItem.GetComponent <TmChangeType>().Level + 1); }
void InitPropertyTwo(TmEntity soulerItem) { soulerItem.GetComponent <TmProperty>().MaxHp = (int)Math.Round(soulerItem.GetComponent <TmProperty>().Stamina *soulerItem.GetComponent <TmSouler>().StaminaRate); //Hp与根骨成正比;暂定10倍; soulerItem.GetComponent <TmProperty>().MaxMp = (int)Math.Round(soulerItem.GetComponent <TmChangeType>().Level *soulerItem.GetComponent <TmSouler>().StaminaRate); //Mp与等级有关;暂定10倍; soulerItem.GetComponent <TmProperty>().Bp = (int)Math.Round(soulerItem.GetComponent <TmProperty>().Brains *soulerItem.GetComponent <TmSouler>().BrainsRate); //Bp与智力成正比;暂定1倍; soulerItem.GetComponent <TmProperty>().Ap = (int)Math.Round(soulerItem.GetComponent <TmProperty>().Power *soulerItem.GetComponent <TmSouler>().PowerRate); //Ap与力量成正比;暂定1倍; }
} //更新属性 void InitPropertyOne(TmEntity soulerItem) { soulerItem.GetComponent <TmProperty>().Stamina = soulerItem.GetComponent <TmSouler>().Stamina + soulerItem.GetComponent <TmChangeType>().Level; soulerItem.GetComponent <TmProperty>().Brains = soulerItem.GetComponent <TmSouler>().Brains + soulerItem.GetComponent <TmChangeType>().Level; soulerItem.GetComponent <TmProperty>().Power = soulerItem.GetComponent <TmSouler>().Power + soulerItem.GetComponent <TmChangeType>().Level; soulerItem.GetComponent <TmProperty>().Agility = soulerItem.GetComponent <TmSouler>().Agility + soulerItem.GetComponent <TmChangeType>().Level; }
void FindPaths(TmEntity entity) { TmAstarComponent path = entity.GetComponent <TmAstarComponent>(); if (!path.isCan) { return; } if (entity.GetComponent <TmSouler>().RoleType == RoleType.Engineer || path.IsKey) { return; } if (path.start != null && path.goal != null && path.grids != null && path.grids.Length > 0) { path.paths = Astar.FindPath(path.start, path.goal, path.grids); path.start = null; path.lastGoal = new TmGrid(path.goal); path.isPath = true; } }
void CheckSession(TmEntity entity) { TmCoolDown cd = entity.GetComponent <TmCoolDown>(); if (!cd.Counting) { entity.Dispose(); //TmTcpSocket.Instance.StartConnect(); } else { //发送心跳检测(并等待签到,签到入口在TmTcpSession里,双向发向即:客户端向服务端发送,服务端向客户端发送) TmParameter mvc = TmParameterTool.ToParameter(TenCode.EessionCD, ElevenCode.Login); mvc.Keys.Add(entity.EcsId); TmTcpSocket.Instance.Send(mvc); } Console.WriteLine(TmTimerTool.CurrentTime() + " CdCount:{0}-{1} ", cd.CdCount, cd.MaxCdCount); //Debug.Log(TmTimerTool.CurrentTime() + " CdCount:" + cd.CdCount + "-" + cd.MaxCdCount); }
void PropertyInit(TmEntity entity) { if (entity.GetComponent <TmProperty>() != null && entity.GetComponent <TmBuffAdd>() != null) { soulerItem = entity.GetComponent <TmProperty>(); property = entity.GetComponent <TmBuffAdd>(); if (soulerItem.Bp != entity.GetComponent <TmBuffAdd>().changeCount) { InitAddProperty(entity); entity.GetComponent <TmBuffAdd>().changeCount = soulerItem.Bp; } } }
void PropertyInit(TmEntity entity) { if (entity.GetComponent <TmProperty>() != null && entity.GetComponent <TmInventoryAdd>() != null) { soulerItem = entity.GetComponent <TmProperty>(); property = entity.GetComponent <TmInventoryAdd>(); if (soulerItem.Stamina != entity.GetComponent <TmInventoryAdd>().changeCount) { InitAddProperty(entity); entity.GetComponent <TmInventoryAdd>().changeCount = soulerItem.Stamina; } } }
void UpdateCoolDown(TmEntity entity) { TmCoolDown cd = entity.GetComponent <TmCoolDown>(); if (cd.Counting) { cd.CdCount += 1; if (cd.CdCount >= cd.MaxCdCount) { cd.CdCount = 0; cd.Counting = false; } } if (cd.Timing) { cd.CdTime += 4; if (cd.CdTime >= cd.MaxCdTime) { cd.CdTime = 0; cd.Timing = false; } } }
void InitPropertyThree(TmEntity soulerItem) { soulerItem.GetComponent <TmProperty>().Sp = Math.Round(soulerItem.GetComponent <TmSouler>().Sp + soulerItem.GetComponent <TmProperty>().Agility *soulerItem.GetComponent <TmSouler>().AgilityRate / (100 * soulerItem.GetComponent <TmChangeType>().Level), 4); //sp暴击率与敏捷成正比。 soulerItem.GetComponent <TmProperty>().Hr = Math.Round(soulerItem.GetComponent <TmSouler>().Hr + soulerItem.GetComponent <TmProperty>().Agility *soulerItem.GetComponent <TmSouler>().AgilityRate / (100 * soulerItem.GetComponent <TmChangeType>().Level), 4); //hr命中率与敏捷成正比。 soulerItem.GetComponent <TmProperty>().Cr = Math.Round(soulerItem.GetComponent <TmSouler>().Cr + soulerItem.GetComponent <TmProperty>().Agility *soulerItem.GetComponent <TmSouler>().AgilityRate / (100 * soulerItem.GetComponent <TmChangeType>().Level), 4); //cr暴击率与敏捷成正比。 }
void UpdateLevel(TmEntity soulerItem) { if (soulerItem.GetComponent <TmChangeType>().Level == soulerItem.GetComponent <TmSkill>().LevelUpLimit) { return; } int expTem = (int)Math.Round((soulerItem.GetComponent <TmChangeType>().Level + 1.0) * (soulerItem.GetComponent <TmChangeType>().Level + 1.0) + 10.0); if (soulerItem.GetComponent <TmChangeType>().Exp >= expTem) { soulerItem.GetComponent <TmChangeType>().Exp -= expTem; soulerItem.GetComponent <TmChangeType>().Level++; if (soulerItem.GetComponent <TmChangeType>().Level >= soulerItem.GetComponent <TmSkill>().LevelUpLimit) { soulerItem.GetComponent <TmChangeType>().Level = soulerItem.GetComponent <TmSkill>().LevelUpLimit; soulerItem.GetComponent <TmChangeType>().Exp = 0; } } } //等级更新
void InitPropertyThree(TmEntity soulerItem) { soulerItem.GetComponent <TmProperty>().Sp = soulerItem.GetComponent <TmSkill>().Sp; //sp暴击率与敏捷成正比。 soulerItem.GetComponent <TmProperty>().Hr = soulerItem.GetComponent <TmSkill>().Hr; //hr命中率与敏捷成正比。 soulerItem.GetComponent <TmProperty>().Cr = soulerItem.GetComponent <TmSkill>().Cr; //cr暴击率与敏捷成正比。 }
void InitPropertyTwo(TmEntity soulerItem) { soulerItem.GetComponent <TmProperty>().MaxHp = soulerItem.GetComponent <TmSkill>().MaxHp; //Hp与根骨成正比;暂定10倍; soulerItem.GetComponent <TmProperty>().Bp = soulerItem.GetComponent <TmSkill>().Bp; //Bp与智力成正比;暂定1倍; soulerItem.GetComponent <TmProperty>().Ap = soulerItem.GetComponent <TmSkill>().Ap; //Ap与力量成正比;暂定1倍; }
void UpdateLevel(TmEntity soulerItem) { if (soulerItem.GetComponent <TmChangeType>().Level == soulerItem.GetComponent <TmSouler>().LevelUpLimit) { return; } int expTem = (int)Math.Round((soulerItem.GetComponent <TmChangeType>().Level + 1.0) * (soulerItem.GetComponent <TmChangeType>().Level + 1.0) + 10.0); if (soulerItem.GetComponent <TmChangeType>().Exp >= expTem) { soulerItem.GetComponent <TmChangeType>().Exp -= expTem; soulerItem.GetComponent <TmChangeType>().Level++; if (soulerItem.GetComponent <TmChangeType>().Level >= soulerItem.GetComponent <TmSouler>().LevelUpLimit) { soulerItem.GetComponent <TmChangeType>().Level = soulerItem.GetComponent <TmSouler>().LevelUpLimit; soulerItem.GetComponent <TmChangeType>().Exp = 0; } soulerItem.GetComponent <TmProperty>().Hp = soulerItem.GetComponent <TmProperty>().MaxHp; soulerItem.GetComponent <TmProperty>().Mp = soulerItem.GetComponent <TmProperty>().MaxMp; } //1-59级:经验值 = ((8 × 角色等级) + 难度系数(角色等级)) × 基础经验值(角色等级) × 经验系数(角色等级) //60级:经验值 = 155 + 基础经验值(角色等级) × (1275 - ((69 - 角色等级) × (3 + (69 - 角色等级) × 4))); //61-69级:经验值 = 155 + 基础经验值(角色等级) × (1344 - ((69 - 角色等级) × (3 + (69 - 角色等级) × 4))); //基础经验值(角色等级) = 45 + (5 × 角色等级) (适用于艾泽拉斯的怪物) 基础经验值(角色等级) = 235 + (5 × 角色等级) (适用于外域的怪物) 基础经验值(角色等级) = 626 + (5 × 角色等级) (适用于诺森德的怪物); //难度系数(角色等级) = 0 (角色等级 <= 28) 难度系数(角色等级) = 1 (角色等级 = 29) 难度系数(角色等级) = 3 (角色等级 = 30) 难度系数(角色等级) = 6 (角色等级 = 31) 难度系数(角色等级) = 5 × (角色等级 - 30) (角色等级 >= 32, <= 59); //经验系数(角色等级) = 1(角色等级 <= 10) 经验系数(角色等级) = (1 - (角色等级 - 10) / 100)(角色等级 >= 11, <= 27) 经验系数(角色等级) = 0.82(角色等级 >= 28, <= 59); } //等级更新