Esempio n. 1
0
        public void EnableTarget(NodeAddedEvent e, [Combine] TargetEffectNode node, [Context, JoinByTeam] TeamNode team)
        {
            StreamHitComponent streamHit = node.streamHit;

            base.NewEvent <UpdateIsisRayModeEvent>().Attach(team).Attach(streamHit.TankHit.Entity).Attach(node).Schedule();
            UpdateRayEffectUpdateEvent eventInstance = new UpdateRayEffectUpdateEvent();

            eventInstance.speedMultipliers = new float[] { float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity };
            base.NewEvent(eventInstance).Attach(node).Attach(streamHit.TankHit.Entity).Schedule();
        }
 private static GameObject GetTeamButton(TeamNode team, ScreenNode screen)
 {
     if (team.teamColor.TeamColor == TeamColor.RED)
     {
         return(screen.battleSelectScreen.EnterBattleRedButton);
     }
     if (team.teamColor.TeamColor != TeamColor.BLUE)
     {
         throw new Exception("Team button not found: " + team.teamColor.TeamColor);
     }
     return(screen.battleSelectScreen.EnterBattleBlueButton);
 }
Esempio n. 3
0
        public void BuildFlag(NodeAddedEvent e, BattleNode ctf, SingleNode <MapInstanceComponent> map, [Combine] FlagNode flag, [JoinByTeam] TeamNode teamNode)
        {
            CTFAssetProxyBehaviour assetProxyBehaviour = GetAssetProxyBehaviour(ctf);
            TeamColor             teamColor            = teamNode.colorInBattle.TeamColor;
            GameObject            original             = (teamColor != TeamColor.RED) ? assetProxyBehaviour.blueFlag : assetProxyBehaviour.redFlag;
            GameObject            obj3      = (teamColor != TeamColor.RED) ? assetProxyBehaviour.blueFlagBeam : assetProxyBehaviour.redFlagBeam;
            FlagInstanceComponent component = new FlagInstanceComponent();
            GameObject            obj4      = Object.Instantiate <GameObject>(original, flag.flagPosition.Position, Quaternion.identity);

            component.FlagInstance = obj4;
            component.FlagBeam     = Object.Instantiate <GameObject>(obj3, obj4.transform, false);
            flag.Entity.AddComponent(component);
            obj4.AddComponent <FlagPhysicsBehaviour>().TriggerEntity = flag.Entity;
            flag.Entity.AddComponent(new FlagColliderComponent(obj4.GetComponent <BoxCollider>()));
        }
Esempio n. 4
0
 public void ToInvisibilityEffectState(NodeAddedEvent e, TeamBattleNode teamBattle, [Context, JoinByBattle] SelfBattleUserInTeamModeNode selfBattleUser, [Context, JoinByTeam] TeamNode selfTeam, [Combine] NameplateNode nameplate, [Context, JoinByTank, Combine] TankInTeamInvisibilityEffectWorkingStateNode tank, [Context, JoinByTeam, Combine] TeamNode tankTeam)
 {
     if (!selfTeam.Entity.Equals(tankTeam.Entity))
     {
         nameplate.nameplateEsm.esm.ChangeState <NameplateStates.NameplateInvisibilityEffectState>();
     }
 }
Esempio n. 5
0
        public void AddMessageLog(FlagEvent e, FlagNode flag, [JoinByTank] TankNode tank2Team, [JoinByTeam] TeamNode tankTeam, FlagNode flag2User, [JoinByTank] TankNode tank2User, [JoinByUser] UserNode user, FlagNode flag2Team, [JoinByTeam] TeamNode flagTeam, [JoinAll] SingleNode <SelfBattleUserComponent> selfUser, [JoinByTeam] Optional <TeamNode> selfTeam, [JoinAll] CombatLogNode combatLog)
        {
            CombatLogCTFMessagesComponent combatLogCTFMessages = combatLog.combatLogCTFMessages;
            string newValue    = GetOwnFlag(selfTeam, flagTeam, combatLogCTFMessages);
            Color  teamColor   = CombatEventLogUtil.GetTeamColor(tankTeam.colorInBattle.TeamColor, combatLog.combatEventLog);
            string messageText = CombatEventLogUtil.ApplyPlaceholder(GetMessage(e, flag.Entity, combatLogCTFMessages).Replace(CombatLogCTFMessagesComponent.OWN, newValue), "{user}", user.userRank.Rank, user.userUid.Uid, teamColor);

            combatLog.uiLog.UILog.AddMessage(messageText);
        }
 public void InitTeamButtonLock(NodeAddedEvent e, [Combine] TeamNode team, [JoinByBattle, Context] BattleNode battle, [JoinByBattle] ScreenNode screen)
 {
     GetTeamButton(team, screen).SetInteractable(!team.Entity.HasComponent <FullTeamComponent>() && this.CanEnter(battle));
 }
Esempio n. 7
0
 public void PlayMelodyWhenSelfBattleUserInCTF(DefineMelodyForRoundRestartEvent evt, SoundsListenerNode listener, SelfTankBattleUserInTeamNode battleUser, [JoinByTeam] TeamNode userTeam, [JoinByBattle] CTFBattleNode dm, [JoinByBattle] ICollection <TeamNode> teams, SingleNode <BattleSoundsAssetComponent> mapEffect)
 {
     this.PlayNonTeamMelodyInTeamMode(userTeam, teams, listener, mapEffect, mapEffect.component.BattleSoundsBehaviour.MinCtfScoreDiff);
 }
Esempio n. 8
0
 public void DestroyPedestal(NodeRemoveEvent e, TeamNode team, [JoinByTeam] SingleNode <FlagPedestalInstanceComponent> pedestal)
 {
     Object.Destroy(pedestal.component.FlagPedestalInstance);
 }
 public void SetTeamChannelLoaded(NodeAddedEvent e, BattleChatGUINode battleChatGUINode, ActiveGeneralChatChannelNode activeGeneralChatChannelNode, NotLoadedTeamChatChannelNode notLoadedTeamChatChannelNode, [JoinAll] SelfUserTeamNode selfUserTeamNode, [JoinByTeam] TeamNode teamNode)
 {
     activeGeneralChatChannelNode.Entity.RemoveComponent <ActiveBattleChannelComponent>();
     notLoadedTeamChatChannelNode.Entity.AddComponent <ActiveBattleChannelComponent>();
     this.SetActiveChannelGUI(battleChatGUINode, teamNode.colorInBattle.TeamColor);
     notLoadedTeamChatChannelNode.Entity.AddComponent <LoadedChannelComponent>();
 }
 public void SwitchToTeamChannel(BattleChannelSwitchEvent e, InactiveTeamChatChannelNode inactiveChannelNode, [JoinAll] SelfUserTeamNode selfIUserNode, [JoinByTeam] TeamNode teamNode, [JoinAll] ActiveChannelNode activeChannelNode, [JoinByScreen] BattleChatGUINode battleChatGUINode)
 {
     this.SwitchActiveChannel(activeChannelNode, inactiveChannelNode);
     this.SetActiveChannelGUI(battleChatGUINode, teamNode.colorInBattle.TeamColor);
 }
Esempio n. 11
0
        public void AddTeamUIColor(NodeAddedEvent e, SelfTankNode selfTank, [Combine, JoinByBattle] TeamNode teamNode)
        {
            TeamColor color = !teamNode.teamGroup.Key.Equals(selfTank.teamGroup.Key) ? TeamColor.RED : TeamColor.BLUE;

            teamNode.Entity.AddComponent(new ColorInBattleComponent(color));
        }
Esempio n. 12
0
 public void AddSpectatorUIColor(NodeAddedEvent e, SpectatorBattleUserNode spectatorBattleUser, [Combine, JoinByBattle] TeamNode teamNode)
 {
     teamNode.Entity.AddComponent(new ColorInBattleComponent(teamNode.teamColor.TeamColor));
 }
Esempio n. 13
0
 public void InitTDMTankPartsForOutlineEffect(InitTeamMatchEvent e, RemoteTankTeamNode remoteTankTeam, [JoinByTank] WeaponNode weapon, [JoinByTeam] TeamNode team, [JoinAll] SelfBattleUserInTeamNode selfBattleUser, [JoinByTeam] TeamNode selfTeam, [JoinAll] SingleNode <TankOutlineColorsComponent> colors)
 {
     this.InitTankPartsForOutlineEffect(remoteTankTeam, weapon);
     if (selfTeam.Entity.Equals(team.Entity))
     {
         remoteTankTeam.tankPartOutlineEffectUnity.MaterialForTankPart.SetColor("_OutlineColor", colors.component.Allies);
         weapon.tankPartOutlineEffectUnity.MaterialForTankPart.SetColor("_OutlineColor", colors.component.Allies);
     }
     else
     {
         remoteTankTeam.tankPartOutlineEffectUnity.MaterialForTankPart.SetColor("_OutlineColor", colors.component.Enemies);
         weapon.tankPartOutlineEffectUnity.MaterialForTankPart.SetColor("_OutlineColor", colors.component.Enemies);
     }
 }
Esempio n. 14
0
 public void OnUserAdded(NodeAddedEvent e, TeamBattleUserNode teamBattleUserNode, [JoinByUser] NotSelfUserNode userNode, TeamBattleUserNode teamBattleUser2Node, [JoinByTeam] TeamNode teamNode, [JoinAll] CombatEventLogNode combatEventLogNode)
 {
     this.AddUserAddedMessage(userNode, teamNode.colorInBattle.TeamColor, combatEventLogNode);
 }
Esempio n. 15
0
        public void BuildPedestal(NodeAddedEvent e, BattleNode ctf, SingleNode <MapInstanceComponent> map, [Combine] FlagPedestalNode flagPedestal, [JoinByTeam] TeamNode teamNode)
        {
            CTFAssetProxyBehaviour        assetProxyBehaviour = GetAssetProxyBehaviour(ctf);
            FlagPedestalInstanceComponent component           = new FlagPedestalInstanceComponent {
                FlagPedestalInstance = Object.Instantiate <GameObject>((teamNode.colorInBattle.TeamColor != TeamColor.RED) ? assetProxyBehaviour.bluePedestal : assetProxyBehaviour.redPedestal, flagPedestal.flagPedestal.Position, Quaternion.identity)
            };

            flagPedestal.Entity.AddComponent(component);
        }
Esempio n. 16
0
 public void DestroyFlag(NodeRemoveEvent e, TeamNode team, [JoinByTeam] SingleNode <FlagInstanceComponent> flag)
 {
     Object.Destroy(flag.component.FlagInstance);
 }
 public void CollectTargetsInTeamBattle(NodeAddedEvent e, ExplosiveMassEffectNode effect, [JoinByTank] SelfTankTeamNode selfTank, [JoinByTeam] TeamNode selfTeam, [JoinByBattle] TeamBattleNode battle, [JoinByBattle, Combine] TeamNode team)
 {
     if (!team.Entity.Equals(selfTeam.Entity))
     {
         CollectTargetsInRadius eventInstance = new CollectTargetsInRadius {
             Radius = effect.explosiveMassEffect.Radius
         };
         Node[] nodes = new Node[] { effect, selfTank, battle, team };
         base.NewEvent(eventInstance).AttachAll(nodes).ScheduleDelayed(((float)effect.explosiveMassEffect.Delay) / 1000f);
     }
 }
        public void DefineColorForTeamMode(NodeAddedEvent evt, [Combine] ShaftAimingTeamColorEffectNode weaponNode, [Context, JoinByTeam] TeamNode team)
        {
            ShaftAimingColorEffectComponent shaftAimingColorEffect = weaponNode.shaftAimingColorEffect;

            shaftAimingColorEffect.ChoosenColor = (team.colorInBattle.TeamColor != TeamColor.BLUE) ? shaftAimingColorEffect.RedColor : shaftAimingColorEffect.BlueColor;
            weaponNode.Entity.AddComponent <ShaftAimingColorEffectPreparedComponent>();
        }
Esempio n. 19
0
 public void CollectTargetsForEMPEffectInTeamBattle(NodeAddedEvent e, EMPEffectNode emp, [JoinByTank] SelfTankTeamNode selfTank, [JoinByTeam] TeamNode selfTeam, [JoinByBattle] TeamBattleNode battle, [JoinByBattle, Combine] TeamNode team)
 {
     if (!team.Entity.Equals(selfTeam.Entity))
     {
         CollectTargetsInRadius eventInstance = new CollectTargetsInRadius {
             Radius = emp.empEffect.Radius
         };
         Node[] nodes = new Node[] { emp, selfTank, battle, team };
         base.NewEvent(eventInstance).AttachAll(nodes).Schedule();
     }
 }
Esempio n. 20
0
 public void CollectTargetsForEMPEffectInTeamBattle(CollectTargetsInRadius e, EffectNode any, SelfTankTeamNode selfTank, TeamBattleNode battle, TeamNode team, [JoinByTeam] ICollection <RemoteTankNode> otherTanks)
 {
     this.CollectTargetsForEMP(e, selfTank, otherTanks);
 }
        public void EvaluateTargets(TargetingEvaluateEvent evt, EvaluatorNode evaluator, [JoinByUser] TankNode tankNode, [JoinByTeam] TeamNode team)
        {
            long key = team.teamGroup.Key;

            List <DirectionData> .Enumerator enumerator = evt.TargetingData.Directions.GetEnumerator();
            while (enumerator.MoveNext())
            {
                DirectionData current = enumerator.Current;
                List <TargetData> .Enumerator enumerator2 = current.Targets.GetEnumerator();
                while (enumerator2.MoveNext())
                {
                    TargetData data3 = enumerator2.Current;
                    if (data3.TargetEntity.GetComponent <TeamGroupComponent>().Key == key)
                    {
                        data3.ValidTarget = false;
                    }
                }
            }
        }
Esempio n. 22
0
        public void AddMessageAutoReturnedFlag(FlagReturnEvent e, NotCarriedFlagNode flag, [JoinByTeam] TeamNode flagTeam, [JoinAll] SingleNode <SelfBattleUserComponent> selfUser, [JoinByTeam] Optional <TeamNode> selfTeam, [JoinAll] CombatLogNode combatEventLog)
        {
            CombatLogCTFMessagesComponent combatLogCTFMessages = combatEventLog.combatLogCTFMessages;
            string newValue    = GetOwnFlag(selfTeam, flagTeam, combatLogCTFMessages);
            string messageText = combatLogCTFMessages.AutoReturned.Replace(CombatLogCTFMessagesComponent.OWN, newValue);

            combatEventLog.uiLog.UILog.AddMessage(messageText);
        }
 public void ShowReceivedTeamMessage(BattleChatUserMessageReceivedEvent e, UserNode userNode, TeamChatNode teamChatNode, [JoinByScreen] BattleChatGUINode battleChatGUINode, [JoinByScreen] ChatContentGUINode chatContentGUINode, [JoinAll] SelfUserTeamNode selfUserTeamNode, [JoinByTeam] TeamNode teamNode)
 {
     this.CreateMessage(chatContentGUINode, battleChatGUINode, userNode.Entity, e.Message, true, teamNode.colorInBattle.TeamColor);
 }
Esempio n. 24
0
 private static string GetOwnFlag(Optional <TeamNode> selfTeam, TeamNode flagTeam, CombatLogCTFMessagesComponent logCtfMessages) =>
 !selfTeam.IsPresent() ? ((flagTeam.colorInBattle.TeamColor != TeamColor.BLUE) ? logCtfMessages.RedFlag : logCtfMessages.BlueFlag) : ((flagTeam.teamGroup.Key != selfTeam.Get().teamGroup.Key) ? logCtfMessages.EnemyFlag : logCtfMessages.OurFlag);
 public void ShowReceivedGeneralMessage(BattleChatUserMessageReceivedEvent e, UserNode userNode, [JoinByUser] TeamBattleUserNode teamBattleUserNode, [JoinByTeam] TeamNode teamNode, GeneralChatNode generalChatNode, [JoinByScreen] BattleChatGUINode battleChatGUINode, [JoinByScreen] ChatContentGUINode chatContentGUINode)
 {
     this.CreateMessage(chatContentGUINode, battleChatGUINode, userNode.Entity, e.Message, false, teamNode.colorInBattle.TeamColor);
 }
Esempio n. 26
0
 public void AddUserToBattleSelectTable(NodeAddedEvent e, [Combine] TeamScoreTableNode scoreTable, [Context, JoinByBattle, Combine] RoundUserNode roundUser, [JoinByTeam] TeamNode teamNode, [JoinAll] SingleNode <BattleSelectScreenComponent> screen)
 {
     if (scoreTable.uiTeam.TeamColor == teamNode.teamColor.TeamColor)
     {
         this.AddRow(scoreTable, roundUser);
     }
 }
Esempio n. 27
0
        public void EnableIsisTargetSound(NodeAddedEvent e, [Combine] TargetEffectTeamNode weapon, [Combine, Context, JoinByTank] IsisCurrentSoundEffectNode isisSound, [Context, JoinByTeam] TeamNode weaponTeam)
        {
            Entity entity = weapon.streamHit.TankHit.Entity;

            base.NewEvent <UpdateIsisSoundModeEvent>().Attach(weapon).Attach(entity).Schedule();
        }