private void becomeInvisible(Skill skill, GameEntity sender) { GameEntityRuntimeData data = sender.GetControllRemote().GetOrUpdateRuntimeData(null); data.visible = false; GameTimer.DelayJobBaseOnCore(skill.effectTime, () => { data.visible = true; }); }
private void doLeidianshu(GameEntity sender) { GameEntity entity = sender.GetTargetEntity(); GameEntityRuntimeData targetData = entity.GetControllRemote().GetOrUpdateRuntimeData(null); GameEntityRuntimeData senderData = sender.GetControllRemote().GetOrUpdateRuntimeData(null); int finalDamage = Mathf.CeilToInt(senderData.atk); entity.GetControllRemote().ChangeHP(finalDamage); }
private void addHujia(Skill skill, GameEntity sender) { GameEntityRuntimeData data = sender.GetControllRemote().GetOrUpdateRuntimeData(null); sender.GetControllRemote().ChangeHujia(Mathf.CeilToInt(data.hujia * 0.1f));//这里应该基于伤害公式来计算,这里是错误的临时写法 GameTimer.DelayJobBaseOnCore(skill.effectTime, () => { //恢复护甲 }); }
private void pingA(GameEntity sender) { GameEntity entity = sender.GetTargetEntity(); GameEntityRuntimeData targetData = entity.GetControllRemote().GetOrUpdateRuntimeData(null); GameEntityRuntimeData senderData = sender.GetControllRemote().GetOrUpdateRuntimeData(null); int finalDamage = Mathf.CeilToInt(senderData.atk - targetData.hujia); finalDamage = 0; entity.GetControllRemote().CaughtDamage(finalDamage, DamageTypeEnum.ColdWeapon); }
private calculateResult calculateSkill(Skill skill, GameEntityControllRemote opSender, GameEntityControllRemote opTarget) { GameEntityRuntimeData senderRuntime = opSender.GetOrUpdateRuntimeData(null); GameEntityRuntimeData targetRuntime = opTarget.GetOrUpdateRuntimeData(null); return(new calculateResult() { type = resultEnum.enum1 | resultEnum.enum2, damagePart = new damageResult() { finalDamage = Mathf.CeilToInt(skill.cd * 2) * 0 } }); }
IEnumerator Start() { m_Transform = this.transform; m_GameObject = this.gameObject; yield return(null); mapController = GameCore.GetRegistServices <MapController>(); currentCell = mapController.GetRandomCell().Point; var mapSize = mapController.GetMapSize(); //this.transform.position = HexCoords.GetHexVisualCoords(currentCell, mapSize); this.transform.position = Coords.PointToVisualPosition(currentCell); //设定职业 applyZhiye(); player_LogicSwitchA = playerUpdate(); playerAndAI_LogicSwitchB = actionRemote.AutoUpdate(); //设定模型外观 int index = GameEntityMgr.Instance.GetAllEntities().IndexOf(this); entityVisual = new GameEntityVisual(this.transform.Find("Model").gameObject, ModelID, index); if (controllType == EntityType.Player) { PlayerEntitiyControll player = new PlayerEntitiyControll(); player.SetEntityID(entityID); controllRemote = player; runtimeData = controllRemote.GetOrUpdateRuntimeData(this); runtimeSwitcher = player_LogicSwitchA; //StartCoroutine(updateContainer()); //Observable.FromCoroutine(updateContainer).Subscribe(); //MainThreadDispatcher.StartCoroutine(updateContainer()); } else if (controllType == EntityType.AI) { entityVisual.ChangeHPColor(Color.cyan); AIEntitiyControll ai = new AIEntitiyControll(); ai.SetEntityID(entityID); controllRemote = ai; runtimeData = controllRemote.GetOrUpdateRuntimeData(this); runtimeSwitcher = playerAndAI_LogicSwitchB; //StartCoroutine(updateContainer()); //Observable.FromCoroutine(updateContainer).Subscribe(); //MainThreadDispatcher.StartCoroutine(updateContainer()); } else if (controllType == EntityType.PlayerSummon) { entityVisual.ChangeHPColor(Color.yellow); AIEntitiyControll ai = new AIEntitiyControll(); ai.SetEntityID(entityID); controllRemote = ai; runtimeData = controllRemote.GetOrUpdateRuntimeData(this); runtimeSwitcher = playerAndAI_LogicSwitchB; //StartCoroutine(updateContainer()); //Observable.FromCoroutine(updateContainer).Subscribe(); } GameTimer.AwaitLoopSecondsBaseOnCore(1, controllRemote.CalledEverySeconds); calculateRangeOnEnterPoint(); initUniRxPrograming(); //if (controllType == EntityControllType.AI) //{ // onReachDst += async () => // { // await new WaitForSeconds(1); // randomMove(); // }; // randomMove(); //} }