コード例 #1
0
 private void Update()
 {
     foreach (KillInfo item in logQ)
     {
         item.Update();
     }
     if (alphaStep == ALPHASTEP.WAIT)
     {
         deltaNext += Time.deltaTime;
         if (deltaNext > 1f)
         {
             alphaStep = ALPHASTEP.START;
         }
     }
     while (logQ.Count > 0)
     {
         KillInfo killInfo = logQ.Peek();
         if (killInfo.IsAlive)
         {
             break;
         }
         logQ.Dequeue();
         if (logQ.Count == 1)
         {
             alphaStep = ALPHASTEP.NONE;
         }
     }
 }
コード例 #2
0
 private void OnKillLog(KillInfo log)
 {
     if (logQ != null)
     {
         logQ.Enqueue(log);
     }
 }
コード例 #3
0
        public static string[] KillsToLines(List <KillInfo> kills)
        {
            string[] lines = new string[kills.Count];

            TimeSpan lastKillTime = TimeSpan.MinValue;

            for (int i = 0; i < kills.Count; i++)
            {
                string   line = "";
                KillInfo ki   = kills[i];

                line += DHFormatter.ToString(ki.Time) + ((ki.Time.TotalSeconds - lastKillTime.TotalSeconds < 8)? "* " : "  ");

                if (ki.Killer != null)
                {
                    line += ki.Killer.Name + " (" + ki.Killer.GetMostUsedHeroClass() + ")";
                }
                else
                {
                    line += "Creeps";
                }

                line    += "  killed  " + ki.Victim.Name + " (" + ki.Victim.GetMostUsedHeroClass() + ")";
                lines[i] = line;

                lastKillTime = ki.Time;
            }

            return(lines);
        }
コード例 #4
0
ファイル: RobotObjective.cs プロジェクト: Jales408/CvGame
 public void OnRobotKilled(KillInfo info)
 {
     if (info.type == EnnemiType.Robot && ++robotCount == robotObjectiveCount)
     {
         AllRobotsKilled();
     }
 }
コード例 #5
0
 private void Update()
 {
     if (killInfo != null)
     {
         deltaTime += Time.deltaTime;
         if (deltaTime > hideTime)
         {
             killInfo  = null;
             deltaTime = 0f;
             show      = false;
         }
         else if (!show && deltaTime > showTime)
         {
             show = true;
             GameObject gameObject = BrickManManager.Instance.Get(killInfo.KillerSequence);
             if (gameObject != null)
             {
                 LookCoordinator component = gameObject.GetComponent <LookCoordinator>();
                 if (component != null)
                 {
                     if (component.IsYang)
                     {
                         VoiceManager.Instance.Play2(hahaVoc[Random.Range(0, hahaVoc.Length)]);
                     }
                     else
                     {
                         VoiceManager.Instance.Play0(hahaVoc[Random.Range(0, hahaVoc.Length)]);
                     }
                 }
             }
         }
     }
 }
コード例 #6
0
        private void OnOrganDead(ref GameDeadEventParam prm)
        {
            if (!prm.src || prm.src.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Organ || !prm.atker)
            {
                return;
            }
            ActorRoot      handle       = prm.src.handle;
            OrganWrapper   organWrapper = handle.AsOrgan();
            COM_PLAYERCAMP actorCamp    = prm.atker.handle.TheActorMeta.ActorCamp;

            if (handle.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier > 0)
            {
                SoldierRegion soldierRegionByRoute = Singleton <BattleLogic> .GetInstance().mapLogic.GetSoldierRegionByRoute(actorCamp, handle.TheStaticData.TheOrganOnlyInfo.AttackRouteID);

                if (soldierRegionByRoute != null)
                {
                    soldierRegionByRoute.SwitchWave(handle.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier, false);
                }
            }
            if (this._supportHighTowerSoldier && organWrapper.cfgInfo.bOrganType == 4)
            {
                List <PoolObjHandle <ActorRoot> > organActors = Singleton <GameObjMgr> .GetInstance().OrganActors;

                bool flag = true;
                for (int i = 0; i < organActors.get_Count(); i++)
                {
                    PoolObjHandle <ActorRoot> ptr = organActors.get_Item(i);
                    if (ptr && ptr.handle.AsOrgan().cfgInfo.bOrganType == organWrapper.cfgInfo.bOrganType && ptr.handle.TheActorMeta.ActorCamp == handle.TheActorMeta.ActorCamp && !ptr.handle.ActorControl.IsDeadState)
                    {
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    this._soldierAddAttrs[(int)actorCamp].HadAdd     = true;
                    this._soldierAddAttrs[(int)actorCamp].MaxHP      = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(335u).dwConfValue;
                    this._soldierAddAttrs[(int)actorCamp].PhycAttack = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(336u).dwConfValue;
                    this._soldierAddAttrs[(int)actorCamp].PhycDefend = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(338u).dwConfValue;
                    this._soldierAddAttrs[(int)actorCamp].MagcAttack = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(337u).dwConfValue;
                    this._soldierAddAttrs[(int)actorCamp].MagcDefend = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(339u).dwConfValue;
                    this._soldierAddAttrs[(int)actorCamp].DropCoin   = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(340u).dwConfValue;
                    this._soldierAddAttrs[(int)actorCamp].DropExp    = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(341u).dwConfValue;
                    this._soldierAddAttrs[(int)actorCamp].ShapeScale = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(342u).dwConfValue;
                    KillNotify theKillNotify = Singleton <CBattleSystem> .GetInstance().TheKillNotify;

                    Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                    if (theKillNotify != null && hostPlayer != null)
                    {
                        bool     bSrcAllies = hostPlayer.PlayerCamp == actorCamp;
                        KillInfo killInfo   = new KillInfo(KillNotify.building_icon, null, KillDetailInfoType.Info_Type_Destroy_All_Tower, bSrcAllies, false, ActorTypeDef.Invalid, false);
                        theKillNotify.AddKillInfo(ref killInfo);
                    }
                }
            }
        }
コード例 #7
0
 private void OnKillLog(KillInfo log)
 {
     if (log.VictimSequence == MyInfoManager.Instance.Seq && log.KillerSequence != log.VictimSequence)
     {
         killInfo  = log;
         deltaTime = 0f;
         show      = false;
     }
 }
コード例 #8
0
 public AgentToDie(Agent agent, Blow blow, KillInfo killInfo)
 {
     //IL_0010: Unknown result type (might be due to invalid IL or missing references)
     //IL_0011: Unknown result type (might be due to invalid IL or missing references)
     //IL_0017: Unknown result type (might be due to invalid IL or missing references)
     //IL_0018: Unknown result type (might be due to invalid IL or missing references)
     this.agent    = agent;
     this.blow     = blow;
     this.killInfo = killInfo;
 }
コード例 #9
0
 private void OnKillLog(KillInfo log)
 {
     if (log.KillerSequence == MyInfoManager.Instance.Seq && log.VictimSequence != MyInfoManager.Instance.Seq)
     {
         serialKill++;
         lastKill = 0f;
         if (!SerialAction() && log.HeadShot != null)
         {
             HeadshotAction();
         }
     }
 }
コード例 #10
0
 private void OnKillLog(KillInfo log)
 {
     if (logQ != null && !(MyInfoManager.Instance.Nickname == log.Victim) && MyInfoManager.Instance.Nickname == log.Killer && log.WeaponBy != 0)
     {
         logQ.Enqueue(log);
         alphaStep = ALPHASTEP.NONE;
         if (logQ.Count > 1)
         {
             alphaStep = ALPHASTEP.WAIT;
             deltaNext = 0f;
         }
     }
 }
コード例 #11
0
 private void Update()
 {
     foreach (KillInfo item in logQ)
     {
         item.Update();
     }
     while (logQ.Count > 0)
     {
         KillInfo killInfo = logQ.Peek();
         if (killInfo.IsAlive)
         {
             break;
         }
         logQ.Dequeue();
     }
 }
コード例 #12
0
 private void OnKillLog(KillInfo log)
 {
 }
コード例 #13
0
 //Kills player, potentially starts timer for respawn too
 public void killPlayerLocal(int playerIdKilled, int playerIdKiller)
 {
     //TODO
     KillInfo ki = new KillInfo(playerIdKiller, playerIdKilled, KillType.ELE);
     killHistory.Add(ki);
     deadPlayers.Enqueue(playerIdKilled);
 }
コード例 #14
0
 private static void Execute(CommandEventArgs e)
 {
     KillInfo.ResetResults();
 }
コード例 #15
0
 /// <summary>
 /// Check the score each time that the local player kill someone
 /// </summary>
 void OnLocalKill(KillInfo info)
 {
     Check();
 }
コード例 #16
0
        private void SpawnSoldier(uint SoldierID)
        {
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff((int)SoldierID);

            if (dataCfgInfoByCurLevelDiff != null)
            {
                if (CActorInfo.GetActorInfo(StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo), enResourceType.BattleScene) != null)
                {
                    Transform      transform = this.Region.transform;
                    COM_PLAYERCAMP campType  = this.Region.CampType;
                    ActorMeta      actorMeta = new ActorMeta {
                        ConfigId  = (int)SoldierID,
                        ActorType = ActorTypeDef.Actor_Type_Monster,
                        ActorCamp = campType
                    };
                    VInt3 position = (VInt3)transform.position;
                    VInt3 forward  = (VInt3)transform.forward;
                    PoolObjHandle <ActorRoot> actor = new PoolObjHandle <ActorRoot>();
                    if (!Singleton <GameObjMgr> .GetInstance().TryGetFromCache(ref actor, ref actorMeta))
                    {
                        actor = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref actorMeta, position, forward, false, true);

                        if (actor != 0)
                        {
                            actor.handle.InitActor();
                            actor.handle.PrepareFight();
                            Singleton <GameObjMgr> .instance.AddActor(actor);

                            actor.handle.StartFight();
                        }
                    }
                    else
                    {
                        ActorRoot handle = actor.handle;
                        handle.TheActorMeta.ActorCamp = actorMeta.ActorCamp;
                        handle.ReactiveActor(position, forward);
                    }
                    if (actor != 0)
                    {
                        if (this.Region.AttackRoute != null)
                        {
                            actor.handle.ActorControl.AttackAlongRoute(this.Region.AttackRoute.GetComponent <WaypointsHolder>());
                        }
                        else if (this.Region.finalTarget != null)
                        {
                            FrameCommand <AttackPositionCommand> cmd = FrameCommandFactory.CreateFrameCommand <AttackPositionCommand>();
                            cmd.cmdId            = 1;
                            cmd.cmdData.WorldPos = new VInt3(this.Region.finalTarget.transform.position);
                            actor.handle.ActorControl.CmdAttackMoveToDest(cmd, cmd.cmdData.WorldPos);
                        }
                        if (!this.isCannonNotified && (this.WaveInfo.bType == 1))
                        {
                            KillNotify killNotifation = Singleton <CBattleSystem> .GetInstance().GetKillNotifation();

                            Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                            if ((killNotifation != null) && (hostPlayer != null))
                            {
                                bool bSrcAllies = hostPlayer.PlayerCamp == actor.handle.TheActorMeta.ActorCamp;
                                if (bSrcAllies)
                                {
                                    KillInfo killInfo = new KillInfo((hostPlayer.PlayerCamp != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? KillNotify.red_cannon_icon : KillNotify.blue_cannon_icon, null, KillDetailInfoType.Info_Type_Cannon_Spawned, bSrcAllies, false, ActorTypeDef.Invalid);
                                    killNotifation.AddKillInfo(killInfo);
                                    this.isCannonNotified = true;
                                }
                            }
                        }
                    }
                }
                if (this.Region.bTriggerEvent)
                {
                    SoldierWaveParam prm = new SoldierWaveParam(this.Index, this.repeatCount, this.Region.GetNextRepeatTime(false));
                    Singleton <GameEventSys> .instance.SendEvent <SoldierWaveParam>(GameEventDef.Event_SoldierWaveNextRepeat, ref prm);
                }
            }
        }
コード例 #17
0
        private void SpawnSoldier(uint SoldierID)
        {
            ResMonsterCfgInfo dataCfgInfoByCurLevelDiff = MonsterDataHelper.GetDataCfgInfoByCurLevelDiff((int)SoldierID);

            if (dataCfgInfoByCurLevelDiff == null)
            {
                return;
            }
            string     path      = StringHelper.UTF8BytesToString(ref dataCfgInfoByCurLevelDiff.szCharacterInfo);
            CActorInfo actorInfo = CActorInfo.GetActorInfo(path, enResourceType.BattleScene);

            if (actorInfo)
            {
                Transform      transform  = this.Region.transform;
                COM_PLAYERCAMP campType   = this.Region.CampType;
                ActorMeta      actorMeta  = default(ActorMeta);
                ActorMeta      actorMeta2 = actorMeta;
                actorMeta2.ConfigId  = (int)SoldierID;
                actorMeta2.ActorType = ActorTypeDef.Actor_Type_Monster;
                actorMeta2.ActorCamp = campType;
                actorMeta            = actorMeta2;
                VInt3 vInt  = (VInt3)transform.position;
                VInt3 vInt2 = (VInt3)transform.forward;
                PoolObjHandle <ActorRoot> poolObjHandle = default(PoolObjHandle <ActorRoot>);
                if (!Singleton <GameObjMgr> .GetInstance().TryGetFromCache(ref poolObjHandle, ref actorMeta))
                {
                    poolObjHandle = Singleton <GameObjMgr> .GetInstance().SpawnActorEx(null, ref actorMeta, vInt, vInt2, false, true);

                    if (poolObjHandle)
                    {
                        poolObjHandle.handle.InitActor();
                        poolObjHandle.handle.PrepareFight();
                        Singleton <GameObjMgr> .instance.AddActor(poolObjHandle);

                        poolObjHandle.handle.StartFight();
                    }
                }
                else
                {
                    ActorRoot handle = poolObjHandle.handle;
                    handle.TheActorMeta.ActorCamp = actorMeta.ActorCamp;
                    handle.ReactiveActor(vInt, vInt2);
                }
                if (poolObjHandle)
                {
                    if (this.Region.AttackRoute != null)
                    {
                        poolObjHandle.handle.ActorControl.AttackAlongRoute(this.Region.AttackRoute.GetComponent <WaypointsHolder>());
                    }
                    else if (this.Region.finalTarget != null)
                    {
                        FrameCommand <AttackPositionCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <AttackPositionCommand>();
                        frameCommand.cmdId            = 1u;
                        frameCommand.cmdData.WorldPos = new VInt3(this.Region.finalTarget.transform.position);
                        poolObjHandle.handle.ActorControl.CmdAttackMoveToDest(frameCommand, frameCommand.cmdData.WorldPos);
                    }
                    if (!this.isCannonNotified && this.WaveInfo.bType == 1 && this.Region != null && (this.Region.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_MID || this.Region.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_NONE))
                    {
                        KillNotify theKillNotify = Singleton <CBattleSystem> .GetInstance().TheKillNotify;

                        Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                        if (theKillNotify != null && hostPlayer != null)
                        {
                            bool flag = hostPlayer.PlayerCamp == poolObjHandle.handle.TheActorMeta.ActorCamp;
                            if (flag)
                            {
                                KillInfo killInfo = new KillInfo((hostPlayer.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? KillNotify.blue_cannon_icon : KillNotify.red_cannon_icon, null, KillDetailInfoType.Info_Type_Cannon_Spawned, flag, false, ActorTypeDef.Invalid, false);
                                theKillNotify.AddKillInfo(ref killInfo);
                                this.isCannonNotified = true;
                            }
                        }
                    }
                    if (this.WaveInfo.bType == 2)
                    {
                        if (!this.isNotifiedBigDragonSoldier && this.Region != null && (this.Region.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_MID || this.Region.RouteType == RES_SOLDIER_ROUTE_TYPE.RES_SOLDIER_ROUTE_NONE))
                        {
                            KillNotify theKillNotify2 = Singleton <CBattleSystem> .GetInstance().TheKillNotify;

                            Player hostPlayer2 = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                            if (theKillNotify2 != null && hostPlayer2 != null)
                            {
                                bool     bSrcAllies = hostPlayer2.PlayerCamp == poolObjHandle.handle.TheActorMeta.ActorCamp;
                                KillInfo killInfo2  = new KillInfo(KillNotify.soldier_bigdragon_icon, null, KillDetailInfoType.Info_Type_Soldier_BigDragon, bSrcAllies, false, ActorTypeDef.Invalid, false);
                                theKillNotify2.AddKillInfo(ref killInfo2);
                                this.isNotifiedBigDragonSoldier = true;
                            }
                        }
                    }
                    else if (this.isNotifiedBigDragonSoldier)
                    {
                        this.isNotifiedBigDragonSoldier = false;
                    }
                }
            }
            SoldierWaveParam soldierWaveParam = new SoldierWaveParam(this.Index, this.repeatCount, this.Region.GetNextRepeatTime(false), this);

            Singleton <GameEventSys> .instance.SendEvent <SoldierWaveParam>(GameEventDef.Event_SoldierWaveNextRepeat, ref soldierWaveParam);
        }
コード例 #18
0
    void onGiveExp(NetworkMessage netMsg)
    {
        KillInfo info = netMsg.ReadMessage <KillInfo>();

        this.player.giveExp(info.exp, info.rewardTextPosition);
    }