Example #1
0
 public FighterModel(int contextualId, short CellId, TeamEnum side, RaidFight fight)
     : base(CellId)
 {
     Team              = side;
     Fight             = fight;
     base.ContextualId = contextualId;
 }
Example #2
0
 public void AddTeam(TeamEnum team)
 {
     if (!DoesTeamExist(team))
     {
         teams.Add(team);
     }
 }
Example #3
0
    public void Goal(TeamEnum team)
    {
        TeamEnum winningTeam = TeamEnum.NONE;

        switch (team)
        {
        case TeamEnum.TEAM1:
            blueTeamScore++;
            blueScoreAnimator.SetTrigger("changeScore");
            if (blueTeamScore >= FinalScore)
            {
                winningTeam = TeamEnum.TEAM1;
            }
            break;

        case TeamEnum.TEAM2:
            redTeamScore++;
            redScoreAnimator.SetTrigger("changeScore");
            if (redTeamScore >= FinalScore)
            {
                winningTeam = TeamEnum.TEAM2;
            }
            break;
        }

        AudioManager2D.instance?.PlaySound("Event_BUT", Camera.main.transform.position);

        UpdateScorePanel();
        if (winningTeam != TeamEnum.NONE)
        {
            TeamWinTheGame(winningTeam);
        }
    }
Example #4
0
        /// <summary>
        /// Seeks for any hookable obstacles/enemies and if found - hooks them to the glove, if possible.
        /// </summary>
        /// <param name="direction">Direction of the seeking raycast.</param>
        /// <param name="team">Team of the seeking caster.</param>
        /// <returns></returns>
        protected override HookingResultEnum TryHookingObject(Vector3 direction, TeamEnum team)
        {
            if (Physics.Raycast(gameObject.transform.position, direction, out _raycastHit))
            {
                var hookedObstacle = _raycastHit.transform.gameObject.GetComponent <IObstacle>();

                if (hookedObstacle == null)
                {
                    return(HookingResultEnum.NoObjectFound);
                }

                if (hookedObstacle.ChkGloveType(ProjectileType) == false)
                {
                    return(HookingResultEnum.WrongType);
                }

                hookedObstacle.SelectObject(team);
                SaveHookedObjectData(hookedObstacle);
                DrawHookingLine();

                return(HookingResultEnum.ObjectHooked);
            }

            return(HookingResultEnum.NoObjectFound);
        }
Example #5
0
    public void SetTeam(TeamEnum side)
    {
        if (indicatorMesh == null)
        {
            return;
        }
        switch (side)
        {
        case TeamEnum.None:
            indicatorMesh.material = noTeamMaterial;
            break;

        case TeamEnum.RedTeam:
            indicatorMesh.material = redTeamMaterial;
            break;

        case TeamEnum.BlueTeam:
            indicatorMesh.material = blueTeamMaterial;
            break;

        default:
            indicatorMesh.material = noTeamMaterial;
            break;
        }
    }
Example #6
0
    public void AttemptToPlace()
    {
        if (!GameManager.instance.TryTakeMoney(attemptingToPlace.cost))
        {
            CleanCursor();
            return;
        }

        Placeable placeable = onCursor.GetComponent <Placeable>();
        TeamEnum  team      = GameManager.instance.currentTeam;

        if (placeable.GetType() == typeof(Building))
        {
            Building building = (Building)placeable;
            building.Place(team);
        }
        else
        {
            placeable.Place(team);
        }



        SetShader("Standard", onCursor.transform.GetChild(0).gameObject);
        attemptingToPlace = null;
    }
Example #7
0
    public void AddData(TeamEnum team)
    {
        for (int i = 0; i < 6; i++)
        {
            heros[teamA.heros[i].hero.id].all++;
        }
        for (int i = 0; i < 6; i++)
        {
            heros[teamB.heros[i].hero.id].all++;
        }
        Team teamWin = null;

        if (team == TeamEnum.teamA)
        {
            teamWin = teamA;
        }
        else
        {
            teamWin = teamB;
        }
        for (int i = 0; i < 6; i++)
        {
            heros[teamWin.heros[i].hero.id].win++;
        }
    }
Example #8
0
        public MonsterFighter(int id, TeamEnum team, Burning.DofusProtocol.Datacenter.Monster monster, int cellId) : base(team)
        {
            this.Id      = id;
            this.CellId  = cellId;
            this.Monster = monster;


            this.Life       = monster.Grades[0].LifePoints;
            this.LifeBase   = monster.Grades[0].LifePoints;
            this.AP         = monster.Grades[0].ActionPoints;
            this.PM         = monster.Grades[0].MovementPoints;
            this.Initiative = (monster.Grades[0].Agility + monster.Grades[0].Chance + monster.Grades[0].Intelligence + monster.Grades[0].Strength + monster.Grades[0].Vitality + monster.Grades[0].Wisdom);


            this.Agility      = monster.Grades[0].Agility;
            this.Water        = monster.Grades[0].Chance;
            this.Intelligence = monster.Grades[0].Intelligence;
            this.Strength     = monster.Grades[0].Strength;
            this.Wisdom       = monster.Grades[0].Wisdom;

            this.AgilityPercentResistance      = monster.Grades[0].AirResistance;
            this.WaterPercentResistance        = monster.Grades[0].WaterResistance;
            this.StrengthPercentResistance     = monster.Grades[0].EarthResistance;
            this.NeutralPercentResistance      = monster.Grades[0].NeutralResistance;
            this.IntelligencePercentResistance = monster.Grades[0].FireResistance;
        }
 public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
 {
     System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
     this.Name                   = binaryReader.ReadString32();
     this.SquadsFlags            = ((Flags)(binaryReader.ReadInt32()));
     this.Team                   = ((TeamEnum)(binaryReader.ReadInt16()));
     this.Parent                 = binaryReader.ReadShortBlockIndex1();
     this.SquadDelayTime         = binaryReader.ReadSingle();
     this.NormalDiffCount        = binaryReader.ReadInt16();
     this.InsaneDiffCount        = binaryReader.ReadInt16();
     this.MajorUpgrade           = ((MajorUpgradeEnum)(binaryReader.ReadInt16()));
     this.fieldpad               = binaryReader.ReadBytes(2);
     this.VehicleType            = binaryReader.ReadShortBlockIndex1();
     this.CharacterType          = binaryReader.ReadShortBlockIndex1();
     this.InitialZone            = binaryReader.ReadShortBlockIndex1();
     this.fieldpad0              = binaryReader.ReadBytes(2);
     this.InitialWeapon          = binaryReader.ReadShortBlockIndex1();
     this.InitialSecondaryWeapon = binaryReader.ReadShortBlockIndex1();
     this.GrenadeType            = ((GrenadeTypeEnum)(binaryReader.ReadInt16()));
     this.InitialOrder           = binaryReader.ReadShortBlockIndex1();
     this.VehicleVariant         = binaryReader.ReadStringID();
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(100));
     this.PlacementScript = binaryReader.ReadString32();
     this.fieldskip       = binaryReader.ReadBytes(2);
     this.fieldpad1       = binaryReader.ReadBytes(2);
     return(pointerQueue);
 }
Example #10
0
 void Start()
 {
     Instance     = this;
     _currentTeam = TeamEnum.TeamBlue;
     SwitchTeam();
     CalculatePoints();
     _unitCanvas.enabled = false;
 }
Example #11
0
 public void SetTeam(TeamEnum _team)
 {
     team = _team;
     foreach (HeroInBattle hero in heros)
     {
         hero.status.team = team;
     }
 }
Example #12
0
 public Team(Player player, TeamEnum team)
 {
     this.players = new List <Player>()
     {
         player
     };
     this.teamEnum = team;
 }
Example #13
0
 public PlayerLoginData(string playerUUID, string playerToken, string playerName, PlayerEnum playerEnum, TeamEnum teamEnum)
 {
     this.playerUUID  = playerUUID;
     this.playerToken = playerToken;
     this.playerName  = playerName;
     this.playerEnum  = playerEnum;
     this.teamEnum    = teamEnum;
 }
Example #14
0
 public void SetTeam(Team teamB)
 {
     team  = teamB.team;
     heros = new List <HeroInBattle>();
     foreach (HeroInBattle hero in teamB.heros)
     {
         heros.Add(new HeroInBattle(hero));
     }
 }
Example #15
0
 public AgentAlgorithmBase(Game game, Agent agent)
 {
     Game      = game;
     TeamEnum  = game.GetTeamFlag(agent);
     EnemyEnum = TeamEnum.GetEnemyTeam();
     Team      = game.GetTeam(TeamEnum);
     Enemy     = game.GetTeam(EnemyEnum);
     Agent     = agent;
 }
Example #16
0
        public void EndFight()
        {
            if (this.FightState == FightStateEnum.FIGHT_ENDED)
            {
                return;
            }

            //fin du timer
            this.CloseTurnTimer();
            this.ElapsdedTime.Stop();
            this.FightState = FightStateEnum.FIGHT_ENDED;

            this.TeamWinner = this.Challengers.FindAll(x => x.Life > 0).Count != 0 ? TeamEnum.TEAM_CHALLENGER : TeamEnum.TEAM_DEFENDER;

            //on enleve le fight de la map
            this.Map.RemoveFight(this);

            List <NetworkMessage> messages = new List <NetworkMessage>();

            List <FightResultListEntry> fightResultLists = new List <FightResultListEntry>();

            foreach (var fighter in this.Fighters)
            {
                //winner = 2 - looser = 0
                int outcome = fighter.Team == this.TeamWinner ? 2 : 0;
                if (fighter is CharacterFighter characterFighter)
                {
                    var client = this.Map.GetClientFromCharacter(characterFighter.Character);

                    double expEarned = FightManager.Instance.GetExperienceEarned(characterFighter.Character, this);
                    var    loots     = FightManager.Instance.GetDropEarned(characterFighter.Character, this);
                    int    kamas     = FightManager.Instance.getKamasEarned(characterFighter.Character, this);


                    FightManager.Instance.SaveCharacterEndFightProgress(this.Map, characterFighter.Character, loots, expEarned, kamas);


                    fightResultLists.Add(new FightResultPlayerListEntry((uint)outcome, 0, new FightLoot(loots, kamas), fighter.Id, fighter.Life > 0, (uint)characterFighter.Character.Level, new List <FightResultAdditionalData>()
                    {
                        new FightResultExperienceData(characterFighter.Character.Experience + expEarned, true, LevelManager.Instance.GetActualLevelExperience <Character>(characterFighter.Character).Experience, true, LevelManager.Instance.GetNextLevelByExperience <Character>(characterFighter.Character).Experience, true, expEarned, true, 0.0, true, 0.0, true, false, 0)
                    }));
                }
                else
                {
                    fightResultLists.Add(new FightResultFighterListEntry((uint)outcome, 0, new FightLoot(), fighter.Id, fighter.Life > 0));
                }
            }

            messages.Add(new GameFightEndMessage((uint)this.ElapsdedTime.ElapsedMilliseconds, 0, -1, fightResultLists, new List <NamedPartyTeamWithOutcome>()));
            //envoyer comme si on charge une map

            this.SendToAllFighters(messages);
            FightManager.Instance.Fights.Remove(this);

            Console.WriteLine("Fin du fight");
        }
Example #17
0
    void Start()
    {
        GM          = FindObjectOfType <GameManager>();
        rb          = GetComponent <Rigidbody>();
        soundSource = GetComponent <AudioSource>();

        soundSource.clip = impactClip;

        assocTeam = TeamEnum.Blue;
    }
Example #18
0
    public void TrainningTeam3(Team teamA, Team teamTemp, ref Team bestTeam, ref int lv)
    {
        if (teamA.heros.Count >= 6)
        {
            //start battle
            TeamEnum enemyTeam = TeamEnum.teamB;
            if (teamA.team == TeamEnum.teamB)
            {
                enemyTeam = TeamEnum.teamA;
            }
            Hero heroDefaul  = heros[0].GetHero(lv);
            Team teamDefault = new Team();
            teamDefault.DefaultTeam(heroDefaul);
            teamDefault.SetTeam(enemyTeam);

            while (Battle(teamA, teamDefault) == teamA.team)
            {
                //Debug.Log("-----------------------------------------------");
                //PrintName(teamA,lv);



                teamA.ResetStatus();
                bestTeam = new Team(teamA);
                //PrintName(bestTeam,lv);
                lv++;
                heroDefaul = heros[0].GetHero(lv);
                teamDefault.DefaultTeam(heroDefaul);
                teamDefault.SetTeam(enemyTeam);
                teamDefault.ResetStatus();
//
//				if(lv>1000)
//				{
//					Debug.Log("<color=#ff0000>wrong something</color>");
//					break;
//				}
            }
        }
        else
        {
            for (int i = 0; i < teamTemp.heros.Count; i++)
            {
                teamA.heros.Add(teamTemp.heros[i]);
                List <HeroInBattle> tempList = new List <HeroInBattle>();
                foreach (HeroInBattle h in teamTemp.heros)
                {
                    tempList.Add(h);
                }
                teamTemp.heros.RemoveAt(i);
                TrainningTeam3(teamA, teamTemp, ref bestTeam, ref lv);
                teamTemp.heros = tempList;
                teamA.heros.RemoveAt(teamA.heros.Count - 1);
            }
        }
    }
Example #19
0
        /// <summary>
        /// Returns color by which a selected object can be highlighted, basing on provided team.
        /// </summary>
        /// <param name="team">Team that selected an object.</param>
        /// <returns></returns>
        public static Color GetHighlightColor(TeamEnum team)
        {
            Color color;

            if (_highlightColor.TryGetValue(team, out color) == false)
            {
                throw new Exception($"Error: team {team} has no color assigned!");
            }

            return(color);
        }
Example #20
0
        public void lerpToPlaceAndLookAtFlag(Sequence s, TeamEnum team, string tutorialMessage)
        {
            Vector3 toFlagVector;

            s.AppendCallback(() => {
                GM.tutorialText.SetText(tutorialMessage);
            });
            s.Append(cam.transform.DOMove(GM.endzoneDictionary[team].transform.position + vertOffset, 2).SetEase(Ease.InOutSine));
            toFlagVector = GM.endzoneDictionary[team].flag.transform.position - (GM.endzoneDictionary[team].transform.position + vertOffset);
            s.Append(cam.transform.DORotateQuaternion(Quaternion.LookRotation(toFlagVector), 2).SetEase(Ease.InOutSine));
        }
Example #21
0
 public Team(Team a)
 {
     team  = a.team;
     heros = new List <HeroInBattle>();
     //	heros = a.heros;
     foreach (HeroInBattle h in a.heros)
     {
         heros.Add(new HeroInBattle(h));
     }
     SetTeam(team);
 }
Example #22
0
    public void SwitchTeam()
    {
        ResetUnits();
        _turn = 0;

        if (_currentTeam == TeamEnum.Blue)
        {
            _currentTeam = TeamEnum.Red;
            return;
        }
        _currentTeam = TeamEnum.Blue;
    }
Example #23
0
    /// <summary>
    /// Inicializar equipo
    /// </summary>
    public void InitTeam(TeamSet tSet)
    {
        //Init team values
        _teamId    = tSet.teamId;
        _teamColor = tSet.teamColor;

        //init units
        foreach (Unit u in units)
        {
            u.InitUnit(this);
        }
    }
 //private float selectTeamTime;
 public void SelectTeam(TeamEnum teamEnum)
 {
     teamSElected = true;
     win.CloseWindow();
     if (_Player.replay.teamEnum != teamEnum)
     {
         //selectTeamTime = Time.time;
         _Player.replay.teamEnum = teamEnum;
         _Player.CallRPC(_Player.SetTeam, (int)teamEnum);
         _Player.Reset();
     }
 }
Example #25
0
        public override void SetTeam(TeamEnum unitTeam)
        {
            base.SetTeam(unitTeam);

            if (_flag != null)
            {
                var meshRenderer = _flag.GetComponent <MeshRenderer>();
                if (meshRenderer != null)
                {
                    meshRenderer.sharedMaterial = Resources.Load <Material>($"Materials/Team {unitTeam.ToString()} Material");
                }
            }
        }
Example #26
0
 public BSpell(int spellId, string name, TeamEnum target, int turns, int relaunch, int targetLife, string targetName)
 {
     this.SpellId    = spellId;
     this.Name       = name;
     this.Target     = target;
     this.Turns      = turns;
     this.Relaunch   = relaunch;
     this.LastTurn   = 1;
     this.TargetLife = targetLife;
     this.TargetName = targetName;
     //this.IsHandToHand = isHandToHand;
     //Me.Id = id
 }
Example #27
0
    public void SetPortraitPos(int playerIndex, TeamEnum playerTeam)
    {
        switch (playerTeam)
        {
        case TeamEnum.TEAM1:
            transform.position = UIManager.instance.bluePlayerPortraitSlots[playerIndex].position;
            break;

        case TeamEnum.TEAM2:
            transform.position = UIManager.instance.RedPlayerPortraitSlots[playerIndex].position;
            break;
        }
    }
Example #28
0
    public void StartGoalAnim(TeamEnum team)
    {
        switch (team)
        {
        case TeamEnum.TEAM1:
            blueGoalScreen.StartGoalAnim();
            break;

        case TeamEnum.TEAM2:
            redGoalScreen.StartGoalAnim();
            break;
        }
    }
Example #29
0
    public void DisplayVictoryScreen(TeamEnum winningTeam)
    {
        switch (winningTeam)
        {
        case TeamEnum.TEAM1:
            blueVictoryScreen.StartEndAnim();
            break;

        case TeamEnum.TEAM2:
            redVictoryScreen.StartEndAnim();
            break;
        }
    }
Example #30
0
        public void addKills(TeamEnum t,int value)
        {
            switch (t)
            {
            case TeamEnum.CHARACTER_TEAM_RED:
                this._redKills += value;
                break;

            case TeamEnum.CHARACTER_TEAM_BLUE:
                this._blueKills += value;
                break;
            }
        }
Example #31
0
 public BSpell(int spellId, string name, TeamEnum target, int turns, int relaunch, int targetLife, string targetName)
 {
     this.SpellId = spellId;
     this.Name = name;
     this.Target = target;
     this.Turns = turns;
     this.Relaunch = relaunch;
     this.LastTurn = 1;
     this.TargetLife = targetLife;
     this.TargetName = targetName;
     //this.IsHandToHand = isHandToHand;
     //Me.Id = id
 }
Example #32
0
 public BFighter GetTarget(TeamEnum teamEnum__1)
 {
     BFighter target = null;
     switch (teamEnum__1)
     {
         case TeamEnum.Ally:
             target = null;
             break;
         case TeamEnum.EmptyCase:
             target = new BFighter(0,NearCell(),0,null,false,0,0,0,0,0);
             break;
         case TeamEnum.Enemy:
             target = NearestMonster();
             break;
         case TeamEnum.Self:
             target = Fighter;
             break;
     }
     return target;
 }