//using ProtoCSStruct; //namespace Battle //{ // public class HeroState // { // public int[] value = new int[(int)HeroStateID.Max]; // } // public static class HeroStateSvc // { // public static bool CanSelected(BattleHero hero) // { // if(IsInState(hero, HeroStateID.NoSelected) || hero.isLeave) // { // return false; // } // return true; // } // // 合法的状态id // public static bool IsValidID(HeroStateID id) // { // return HeroStateID.None < id && id < HeroStateID.Max; // } // // 返回值: // public static bool AddState(BattleHero hero, HeroStateID id) // { // if (! IsValidID(id)) // { // return false; // } // hero.state.value[(int)id]++; // hero.Battle.Trace("HeroStateSvc.AddState hero {0} {1} {2}", hero.objId, id, hero.state.value[(int) id]); // //第一次需要通知表现 // if (hero.state.value[(int)id] == 1) // { // } // if (hero.state.value[(int)id] >= 1) // { // switch (id) // { // case HeroStateID.Stun: // hero.lastAddStunTimeMs = hero.Battle.GetLogicTimeMs(); // break; // case HeroStateID.HideShow: // hero.Battle.NotifyHeroHideState(hero.objId, 1); // break; // case HeroStateID.Frozen: // hero.Battle.NotifyHeroStopState(hero.objId, 1); // break; // } // return true; // } // return false; // } // public static void SubState(BattleHero hero, HeroStateID id) // { // if (! IsValidID(id)) // { // return ; // } // if (hero.state.value[(int)id] > 0) // { // hero.state.value[(int)id]--; // hero.Battle.Trace("HeroStateSvc.SubState hero {0} {1} {2}", hero.objId, id, hero.state.value[(int) id]); // if (hero.state.value[(int)id] == 0) // { // switch (id) // { // case HeroStateID.HideShow: // hero.Battle.NotifyHeroHideState(hero.objId, 0); // break; // case HeroStateID.Frozen: // hero.Battle.NotifyHeroStopState(hero.objId, 0); // break; // case HeroStateID.StaticAtkSpeed: // BattleLogicUpdate.UpdateAtkSpeedInfo(hero); // break; // } // } // } // return ; // } // /// // /// 清楚状态 // /// // /// // /// // public static void ClearState(BattleHero hero, HeroStateID id) // { // if (!IsValidID(id)) // { // return; // } // if (hero.state.value[(int)id] > 0) // { // hero.state.value[(int)id] = 0; // if (AIScriptBattle._logLevel <= BattleConst.LLTrace) // hero.Battle.Trace("HeroStateSvc.ClearState hero {0} {1}", hero.objId, id); // if (AIScriptBattle.needJsonOutput) // { // RemoveStateOutput removeState = new RemoveStateOutput(); // removeState.heroObjId = hero.objId; // removeState.stateId = (int)id; // hero.Battle.NotifyOutput(BattleIOType.RemoveState, SerializeObj.Serialize(removeState)); // return; // } // } // return; // } // public static bool IsInState(BattleHero hero, HeroStateID id) // { // if (IsValidID(id)) // { // return hero.state.value[(int)id] > 0; // } // return false; // } // } //}