Exemplo n.º 1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            Vector2 textureOrigin = new Vector2(this.ShipImage.Texture.Width / 2f, this.ShipImage.Texture.Height / 2f);

            if (!this.Ship.Sunk)
            {
                spriteBatch.Draw(this.ShipImage.Texture, this.Ship.Position);
            }
            else
            {
                spriteBatch.Draw(
                    this.ShipImage.Texture,
                    this.Ship.Position,
                    null,
                    Color.DarkCyan,
                    0f,
                    textureOrigin,
                    1.0f,
                    SpriteEffects.FlipVertically,
                    0f);
            }

            BallControls.CannonBallDraw(this.PlayerType, spriteBatch);
            CombatManager.Draw(spriteBatch);
            Boss.Instance.Draw(spriteBatch);
        }
Exemplo n.º 2
0
 public void UnloadContent()
 {
     this.ShipImage.UnloadContent();
     BallControls.CannonBallUnloadContent();
     CombatManager.UnloadContent();
     Boss.Instance.UnloadContent();
 }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 4
0
    public void CombatStarted()
    {
        state = GameState.Combat;

        audioManager.EnterCombat();

        //initialize combat stuff
        combatManager = gameObject.AddComponent <CombatManager>();
        combatManager.initCombat(playerChars, ((CombatRoom)currentRoom).enemies, this);

        /* send lists of players and enemies to clients
         * "players:clientID:characterID:..."
         */
        string playerString = "players:";

        foreach (int key in playerChars.Keys)
        {
            playerString = playerString + key + ":" + playerChars[key].ID + ":"; //TODO: currently sending client ID, will also need to send character ID
        }
        serverListener.sendMessageToAllClients(playerString);
        string enemiesString = "enemies:";

        foreach (int key in combatManager.enemies.Keys) //key is character ID of enemy
        {
            enemiesString = enemiesString + key + ":" + combatManager.enemies[key].ID + ":";
        }
        serverListener.sendMessageToAllClients(enemiesString);

        //inform clients of combat
        serverListener.sendMessageToAllClients("combat");
    }
Exemplo n.º 5
0
        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Comando inválido! Use ':atirar [usuário]'.", 1);
                return;
            }

            GameClients.GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null)
            {
                Session.SendWhisper("Ocorreu um erro ao tentar encontrar esse usuário, talvez ele esteja offline.", 1);
                return;
            }

            RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Username);

            if (TargetUser == null)
            {
                Session.SendWhisper("Ocorreu um erro ao encontrar esse usuário, talvez ele não esteja online ou nesta sala.", 1);
                return;
            }

            if (TargetClient.MachineId == Session.MachineId)
            {
                Session.SendWhisper("Você não pode se atirar ou atirar em sua outra conta!", 1);
                return;
            }

            Session.GetRoleplay().LastCommand = ":atirar " + Params[1];
            CombatManager.GetCombatType("gun").Execute(Session, TargetClient);
        }
Exemplo n.º 6
0
    public override bool HandleSelection(GameObject gameObject)
    {
        bool wasConsumed = false;

        Hex selectedHex = gameObject.GetComponent <Hex>();

        if (selectedHex != null)
        {
            CharacterData selectedOpponent = selectedHex.GetOccupier();
            if (selectedOpponent != null && BattleManager.controlledCharacter.ValidateCombat(selectedOpponent, selectedHex))
            {
                ContextManager.LockContext(this);
                BattleManager.ConsumeAP(BattleManager.controlledCharacter.GetWeapon().APCost);
                CombatManager.SimulateCombat(BattleManager.controlledCharacter, selectedOpponent);
                wasConsumed = true;
                ContextManager.UnlockContext(this);
            }
            else
            {
                wasConsumed = true;
            }

            ContextManager.EndContext();
        }
        return(wasConsumed);
    }
Exemplo n.º 7
0
    public virtual void TakeDamage(int damage)
    {
        if (damage > 0)
        {
            GameObject    g  = GameObject.FindGameObjectWithTag("CombatManager");
            CombatManager cm = g.GetComponent <CombatManager>();
            (cm.GetGroupFighterOfFighter(this)).OneFighterTookDamage();

            bHasTookDamage = true;
            justTookDamage = true;
        }

        nCurrentHealth -= damage;
        bHasbeenAttcked = true;


        if (nCurrentHealth <= 0)
        {
            nCurrentHealth = 0;
            AkSoundEngine.SetSwitch("Tension", "T4", GameObject.FindGameObjectWithTag("MainCamera"));
        }
        if (nCurrentHealth > nHealthMax)
        {
            nCurrentHealth = nHealthMax;
        }
    }
    private void OnCollisionEnter(Collision collision)
    {
        if (alive && damageOnCollision)
        {
            if (collision.gameObject.tag == "Player")
            {
                CombatManager enemyCM = collision.gameObject.transform.GetComponent <CombatManager>();

                // If enemy is a combatable object, calculate and deal damage to it
                if (enemyCM)
                {
                    int damage = enemyStats.GetDamagePower();

                    enemyCM.Damage(damage);

                    Rigidbody playerRB = collision.gameObject.GetComponent <Rigidbody>();

                    Vector3 targetDir = collision.transform.position - transform.position;

                    playerRB.AddForce(targetDir.normalized * 10, ForceMode.Impulse);
                    playerRB.velocity = Vector3.zero;
                }
            }
        }
    }
Exemplo n.º 9
0
    private void Awake()
    {
        hitAreaCollider = GetComponent <Collider2D>();

        _devManager    = FindObjectOfType <DevManager>();
        _combatManager = FindObjectOfType <CombatManager>();
    }
Exemplo n.º 10
0
 void Start()
 {
     CI = GetComponent <CustomInputs>();
     CM = FindObjectOfType <CombatManager>();
     AM = GetComponent <AudioManager>();
     MM = GetComponent <MusicManager>();
 }
Exemplo n.º 11
0
        // def vs att
        private void DefendersCombat()
        {
            int result = CombatManager.Versus(thisTile.Defenders, thisTile.EnemyAtackers, false);

            Debug.Log(result);

            switch (result)
            {
            case 1:
                CombatManager.DoubleOneWaySingleAttack(thisTile.Gatherers, thisTile.EnemyAtackers, thisTile.Defenders);
                return;

            case 5: result = CombatManager.Versus(thisTile.Gatherers, thisTile.EnemyAtackers, true);
                if (result == 1)
                {
                    CombatManager.OneWayAttackLoop(thisTile.EnemyAtackers, thisTile.Gatherers);
                }

                return;

            case 6: CombatManager.OneWayAttackLoop(thisTile.Gatherers, thisTile.EnemyAtackers);
                return;

            case 7:
                Debug.Log(result);
                CombatManager.OneWayAttackLoop(thisTile.Gatherers, thisTile.EnemyAtackers);
                return;

            default:
                return;
            }
        }
        public void Can_Create()
        {
            (Creature c1, Creature c2) = CreatureCreatures();
            CombatManager cm = new CombatManager(c1, c2);

            Assert.IsNotNull(cm);
        }
Exemplo n.º 13
0
    // interacts with this world interaction
    public void interact()
    {
        switch (ownInteractionType)
        {
        case InteractionTypes.CombatStart:
            CombatManager.startCombat(enemies);
            break;

        case InteractionTypes.DialogStart:
            DialogManager dialogManager = this.GetComponentInParent <DialogManager> ();
            if (dialogManager == null)
            {
                Debug.Log("Error: no DialogManager component found");
                return;
            }
            dialogManager.beginDialog();
            break;

        case InteractionTypes.SceneChange:
            GameStateManager state = GameStateManager.getGameStateManager();
            state.state.playerX = playerX;
            state.state.playerY = playerY;
            SceneManager.LoadScene(sceneName);
            break;
        }
    }
Exemplo n.º 14
0
        public bool Startup()
        {
            Input.multiTouchEnabled = true;

            LocalCache.LoadCache();
            LocalData.Generate();
            Lang.Load();

            AudioManager.MuteAllAudio(true);

            foreach (var Entity in UIConfigure.UIList)
            {
                LiteConfigure.UIDescList.Add(Entity.Key, Entity.Value);
            }

            if (!CombatManager.Startup() || !PlayerManager.Startup())
            {
                return(false);
            }

            AudioManager.PlayMusic(new AssetUri("audio/bgm_titan.mp3"), true, 0.5f);

            TestSkill();
            //PlayerManager.CreateMainEmitter();
            //WaveManager.LoadWave((uint)PlayerManager.Player.Wave);

            LuaRuntime.ExecuteMainLuaFile("main");
            return(true);
        }
Exemplo n.º 15
0
    public void Finish(CombatManager combat)
    {
        for (int k = 0; k < 6; k++)
        {
            if (k < 3)
            {
                combat.Player[0].allies[i] = combat.Player[i];
                combat.Player[1].allies[i] = combat.Player[i];
                combat.Player[2].allies[i] = combat.Player[i];

                combat.Player[0].enemies[i] = combat.Enemy[i];
                combat.Player[1].enemies[i] = combat.Enemy[i];
                combat.Player[2].enemies[i] = combat.Enemy[i];
            }
            else
            {
                combat.Enemy[0].allies[i] = combat.Enemy[i];
                combat.Enemy[1].allies[i] = combat.Enemy[i];
                combat.Enemy[2].allies[i] = combat.Enemy[i];

                combat.Enemy[0].enemies[i] = combat.Player[i];
                combat.Enemy[1].enemies[i] = combat.Player[i];
                combat.Enemy[2].enemies[i] = combat.Player[i];
            }
        }
    }
Exemplo n.º 16
0
    public virtual void ObserverUpdate(object sender, object message)
    {
        if (sender is CombatManager)
        {
            CombatManager manager = (CombatManager)sender;

            if (message is BattleState)
            {
                switch ((BattleState)message)
                {
                //for animations perhaps? I planned on this being much more useful,
                //but then I realized the CombatManager handles everything pretty well on its own
                //but I want to keep it in here

                case BattleState.NextTurn:
                    OnStartNextTurn();
                    break;

                case BattleState.TurnOver:
                    OnPerformedTurn(manager.currentParticipant);
                    break;

                case BattleState.BattleBegins:
                    OnBeginsBattle();
                    break;

                case BattleState.BattleEnds:
                    OnEndsBattle();
                    break;
                }
            }
        }
    }
Exemplo n.º 17
0
    void Awake()
    {
        _gameManager = FindObjectOfType <GameManager>();
        if (_gameManager == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }


        _locationManager = GetComponentInChildren <LocationManager>();
        if (_locationManager == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _movementManager = GetComponentInChildren <MovementManager> ();
        if (_movementManager == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }

        _combatManager = GetComponentInChildren <CombatManager> ();
        if (_combatManager == null)
        {
            Debug.LogError("OOPSALA we have an ERROR!");
        }
    }
Exemplo n.º 18
0
        public override void PerformEffect(BattleGroupEntity targetGroup, Ability abilityData, int count)
        {
            List <AssignmentGroupEntity> targetLine = new List <AssignmentGroupEntity>();

            if (!CombatManager.CheckIfLineIsDead(targetGroup.frontline))
            {
                targetLine.AddRange(targetGroup.frontline);
            }
            else if (!CombatManager.CheckIfLineIsDead(targetGroup.supportline))
            {
                targetLine.AddRange(targetGroup.supportline);
            }

            if (!CombatManager.CheckIfLineIsDead(targetGroup.backline))
            {
                targetLine.AddRange(targetGroup.backline);
            }

            if (targetLine.Count > 0)
            {
                Random r      = new Random();
                int    target = -1;
                do
                {
                    target = r.Next(0, targetLine.Count);
                } while (targetLine[target].turnStartCount == 0);
                targetLine[target].TakeDamage(abilityData.power * count);
            }
        }
Exemplo n.º 19
0
 protected override void OnAwake()
 {
     base.OnAwake();
     manager       = GameObject.FindObjectOfType <CombatManager>();
     renderer      = this.GetComponent <SpriteRenderer>();
     npcController = this.GetComponent <NPCController>();
 }
Exemplo n.º 20
0
        public override void PerformSetup(Context context, IState previousState)
        {
            base.PerformSetup(context, previousState);

            _partyDataWrapper = context.Get <PartyDataWrapper>();

            EnemyDefinitionsById = CombatSettings.Enemies.ToDictionary(
                x => x.Id,
                x => HackUtil.GetDefinition <EnemyDefinition>(x.Class.Id));

            PlayerController = new PlayerCharacterController(_partyDataWrapper);
            PlayerController.CombatCompleteSignal.Listen(OnCombatComplete);
            PlayerController.GameStateUpdatedSignal.Listen(OnGameStateUpdated);
            PlayerController.ActiveCharacterChanged += OnActiveCharacterChanged;

            List <IParty> partiesInCombat = new List <IParty>(2);

            partiesInCombat.Add(new Party(
                                    PlayerController.PartyId,
                                    PlayerController,
                                    _partyDataWrapper.Characters));

            foreach (var partyGroup in CombatSettings.Enemies.GroupBy(x => x.Party))
            {
                partiesInCombat.Add(new Party(
                                        partyGroup.Key,
                                        CombatSettings.AI,
                                        partyGroup.ToArray()));
            }

            _combatManager = new CombatManager(
                partiesInCombat,
                PlayerController.GameStateUpdatedSignal,
                PlayerController.CombatCompleteSignal);
        }
 // Update is called once per frame
 void Update()
 {
     if (player.InCombat)
     {
         manager = GameObject.FindGameObjectWithTag("CombatManager").GetComponent <CombatManager>();
     }
 }
Exemplo n.º 22
0
        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.GetRoleplay().LastCommand = ":soco";
                CombatManager.GetCombatType("fist").Execute(Session, null, true);
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);

            if (TargetClient == null)
            {
                RoomUser Bot = Room.GetRoomUserManager().GetBotByName(Params[1]);

                if (Bot != null && Bot.GetBotRoleplay() != null)
                {
                    Session.GetRoleplay().LastCommand = ":soco " + Params[1];
                    CombatManager.GetCombatType("fist").ExecuteBot(Session, Bot.GetBotRoleplay());
                    return;
                }

                Session.GetRoleplay().LastCommand = ":soco " + Params[1];
                Session.SendWhisper("Ocorreu um erro ao tentar encontrar esse usuário, talvez ele esteja offline.", 1);
                return;
            }

            if (Room == null)
            {
                Session.GetRoleplay().LastCommand = ":soco " + Params[1];
                Session.SendWhisper("Ocorreu um erro ao encontrar esse usuário, talvez ele não esteja online ou nesta sala.", 1);
                return;
            }

            if (TargetClient == null)
            {
                Session.GetRoleplay().LastCommand = ":soco " + Params[1];
                Session.SendWhisper("Ocorreu um erro ao encontrar esse usuário, talvez ele não esteja online ou nesta sala.", 1);
                return;
            }

            if (TargetClient.GetHabbo() == null)
            {
                Session.GetRoleplay().LastCommand = ":soco " + Params[1];
                Session.SendWhisper("Ocorreu um erro ao encontrar esse usuário, talvez ele não esteja online ou nesta sala.", 1);
                return;
            }

            RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Username);

            if (TargetUser == null)
            {
                Session.GetRoleplay().LastCommand = ":soco " + Params[1];
                Session.SendWhisper("Ocorreu um erro ao encontrar esse usuário, talvez ele não esteja online ou nesta sala.", 1);
                return;
            }

            Session.GetRoleplay().LastCommand = ":soco " + Params[1];
            CombatManager.GetCombatType("fist").Execute(Session, TargetClient);
        }
Exemplo n.º 23
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         CombatManager.StartCombat(other.gameObject, this.gameObject);
     }
 }
Exemplo n.º 24
0
    public void ElementalBlast(Vector3 targetLocation)
    {
        if (playing)
        {
            //get all enemies in certain radius
            List <EnemyScript> enemiesInRange = new List <EnemyScript>();
            CombatManager      combatManager  = GameObject.FindGameObjectWithTag("CombatManager").GetComponent <CombatManager>();

            foreach (EnemyScript enemy in combatManager.enemies)
            {
                if (Vector3.Distance(targetLocation, enemy.transform.position) <= abilityRadius)
                {
                    enemiesInRange.Add(enemy);
                }
            }

            foreach (EnemyScript enemy in enemiesInRange)
            {
                Attack(enemy);
            }

            comLog[2].text = comLog[1].text;
            comLog[1].text = comLog[0].text;
            comLog[0].text = "Milosh used Elemental Blast!";
        }
    }
Exemplo n.º 25
0
        public override List <SkillResult> performSkills()
        {
            List <SkillResult> results = new List <SkillResult>();

            if (!Inactive)
            {
                if (Constants.ALLOW_MOB_ATTACKS)
                {
                    List <Character> charactersInRange = this.CharactersInRange.Invoke(this);
                    if (charactersInRange.Count > 0)
                    {
                        foreach (var skill in skills)
                        {
                            if (skill.CoolDownOver)
                            {
                                CombatManager.getInstance().CombatRequests.Add(new CombatRequest()
                                {
                                    Skill   = skill,
                                    Source  = this,
                                    Targets = charactersInRange
                                });
                            }
                        }
                    }
                }
            }
            return(results);
        }
Exemplo n.º 26
0
        public void Refresh()
        {
            _combatTimer = PVP_COMBAT_TIMEOUT;

            bool needFirstAI = false, needSecondAI = false;

            if (_suppressFirst)
            {
                _suppressFirst = false;
                needFirstAI    = first.GetCombatManager().UpdateOwnerCombatState();
            }
            if (_suppressSecond)
            {
                _suppressSecond = false;
                needSecondAI    = second.GetCombatManager().UpdateOwnerCombatState();
            }

            if (needFirstAI)
            {
                CombatManager.NotifyAICombat(first, second);
            }
            if (needSecondAI)
            {
                CombatManager.NotifyAICombat(second, first);
            }
        }
Exemplo n.º 27
0
 void Start()
 {
     combatManager = this;
     owner         = GetComponentInParent <Player>();
     //Debug.Log(combatManager.gameObject.name + " is where combat manager is assigned");
     Grid.EventManager.RegisterListener(Constants.GameEvent.TurnStarted, OnTurnStart);
 }
Exemplo n.º 28
0
    private void MakeGenerals()
    {
        GameObject generalPrefab = DataLibrary.GetCreatureFromName("General");

        CombatManager.SpawnPermanent(generalPrefab, Owner.PLAYER, new MapPosition(0, 2));
        CombatManager.SpawnPermanent(generalPrefab, Owner.ENEMY, new MapPosition(13, 2));
    }
Exemplo n.º 29
0
 // Use this for initialization
 void Start()
 {
     backButton = GameObject.Find("BackButton").GetComponent <Button>();
     backButton.onClick.AddListener(ToggleSkillMenu);
     cancelButton = GameObject.Find("CancelButton").GetComponent <Button> ();
     cancelButton.onClick.AddListener(CancelAction);
     //skillButton = GameObject.FindGameObjectsWithTag ("Skill");
     skillButton     = new GameObject[6];
     skillButton [0] = GameObject.Find("Skill1Button");
     skillButton [1] = GameObject.Find("Skill2Button");
     skillButton [2] = GameObject.Find("Skill3Button");
     skillButton [3] = GameObject.Find("Skill4Button");
     skillButton [4] = GameObject.Find("Skill5Button");
     skillButton [5] = GameObject.Find("Skill6Button");
     skillMenu       = GameObject.Find("SkillButton").GetComponent <Button>();
     skillMenu.onClick.AddListener(ToggleSkillMenu);
     pageNextButton = GameObject.Find("PageNextButton").GetComponent <Button> ();
     //pageNextButton.onClick.AddListener (()=>ToggleVisibleSkills (1));
     pageBackButton = GameObject.Find("PageBackButton").GetComponent <Button> ();
     //pageBackButton.onClick.AddListener (()=>ToggleVisibleSkills (2));
     phasePanel        = GameObject.Find("PhasePanel").GetComponentInChildren <Image> ();
     phaseText         = GameObject.Find("PhasePanel").GetComponentInChildren <Text> ();
     actionPanel       = GameObject.Find("ActionPanel").GetComponent <Image>();
     actionText        = GameObject.Find("ActionPanel").GetComponentInChildren <Text>();
     actionButtons     = new ButtonsUI[skillButton.Length + 2];
     actionButtons [0] = GameObject.Find("ThrowButton").GetComponent <ButtonsUI> ();
     actionButtons [1] = GameObject.Find("CatchButton").GetComponent <ButtonsUI> ();
     for (int i = 0; i < skillButton.Length; i++)
     {
         actionButtons [i + 2] = skillButton [i].GetComponent <ButtonsUI> ();
     }
     openMenu = 0;
     tCursors = GameObject.Find("TargetCursors").GetComponent <TargetCursor> ();
     CM       = GameObject.Find("CombatManager").GetComponent <CombatManager> ();
 }
Exemplo n.º 30
0
    // Start is called before the first frame update
    void Start()
    {
        cManager   = SingletonManager.Get <CombatManager>();
        cSelection = SingletonManager.Get <CharacterSelection>();

        cSelection.OnSelectCharacter.AddListener(UpdateStatsByCharacter);
    }
 public void takeDamage(int d)
 {
     health -= d;
     if(health < 0){
         if(combatManager == null) combatManager = GameObject.FindGameObjectWithTag("CombatManager").GetComponent<CombatManager>();
         combatManager.destroyEnemy(gameObject);
     }
 }
Exemplo n.º 32
0
    public void EnablePrepDisplayer(CombatManager combatManager, MissionCharacterManager characterManager,
		MissionUIToggler uiToggler,ModeTextDisplayer modeTextDisplayer)
    {
        this.combatManager = combatManager;
        this.characterManager = characterManager;
        this.modeTextDisplayer = modeTextDisplayer;
        this.uiToggler = uiToggler;
        main = this;
    }
Exemplo n.º 33
0
 void Awake()
 {
     // Ensure only 1 singleton
     if (null != _Singleton)
     {
         ARKLogger.LogMessage(eLogCategory.General,
                              eLogLevel.System,
                              "CombatManager: Multiple CombatManager violate Singleton pattern.");
     }
     _Singleton = this;
 }
Exemplo n.º 34
0
    public void Initialize(World w)
    {
        instance = this;
        activeWorld = w;

        playerStatus = new PlayerStatus[2];
        playerStatus[0] = new PlayerStatus(0);
        playerStatus[1] = new PlayerStatus(1);

        player1 = new AICommander(playerStatus[0].id, lightArmy);
        player2 = new AICommander(playerStatus[1].id, darkArmy);
    }
 void Update()
 {
     if(combatManager == null) combatManager = GameObject.FindGameObjectWithTag("CombatManager").GetComponent<CombatManager>();
     if(target != null){
         if(Vector3.Distance(transform.position, target.transform.position) <= attackRadius){
             StartCoroutine("Attack");
         }
     }else{
         if(combatManager.enemyList.Count > 0){
             target = combatManager.enemyList[0];
         }
     }
 }
Exemplo n.º 36
0
 public void SetCombatManager(CombatManager newCombatManager)
 {
     m_combatManager = newCombatManager;
 }
Exemplo n.º 37
0
    public void EnableCombatCardTargeter(CombatManager cardsScreen, MissionCharacterManager characterManager
		, MissionUIToggler uiToggler, ModeTextDisplayer modeTextDisplayer)
    {
        this.combatManager = cardsScreen;
        this.characterManager = characterManager;
        this.modeTextDisplayer = modeTextDisplayer;
        this.uiToggler = uiToggler;
        main = this;
    }
Exemplo n.º 38
0
    // Initialize
    void Awake()
    {
        Debug.Log("CombatManager Awake");

        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        BoardManager = GetComponent<CombatBoardManager>();
        OverlayManager = GetComponent<HexOverlayManager>();
        UIManager = GetComponent<CombatUIManager>();

        // Combat entrance animations

        // Set up board, objects, UI
        InitializeCombat();

        // Initialize UI elements (player skills, health, items)
        InitializeUI();

        // Start the game
        _turnState = TurnState.StartPlayerTurn;
    }
Exemplo n.º 39
0
 public void RegisterCombatManager(CombatManager combatManager)
 {
     m_combatManager = combatManager;
 }
Exemplo n.º 40
0
 /// <summary>
 /// Checks to see if any pawns have been defeated
 /// Removes pawn from the list of active pawns if it has been defeated
 /// </summary>
 /// <returns></returns>
 public virtual List<CombatPawn> CheckForDefeatedPawns()
 {
     List<CombatPawn> defeatedPawns = new List<CombatPawn>();
     foreach (CombatPawn pawn in m_activePawnsOnTeam)
     {
         if (!pawn.IsAlive)
         {
             defeatedPawns.Add(pawn);
         }
     }
     foreach(CombatPawn pawn in defeatedPawns)
     {
         RemovePawnFromTeam(pawn);
         m_combatManager = FindObjectOfType<CombatManager>();
         CManager.RemovePawnMove(pawn);
         _disablePawnMesh(pawn);
     }
     return defeatedPawns;
 }
Exemplo n.º 41
0
 void Awake()
 {
     this._CombatMngr = CombatManager.Singleton;
 }
 // Use this for initialization
 void Start()
 {
     combatManager = GameObject.FindGameObjectWithTag("CombatManager").GetComponent<CombatManager>();
 }
 public void EnableCombatCardSelector(CombatManager combatManager)
 {
     this.combatManager = combatManager;
 }
Exemplo n.º 44
0
 public void Start()
 {
     DontDestroyOnLoad(this);
     m_combatManager = FindObjectOfType<CombatManager>();
     m_scenePhotonView = GetComponent<PhotonView>();
 }
Exemplo n.º 45
0
 /// <summary>
 /// Setter for the pawn's CombatManager
 /// </summary>
 /// <param name="newCombatManager"></param>
 public void RegisterCombatManager(CombatManager newCombatManager)
 {
     m_combatManager = newCombatManager;
 }
Exemplo n.º 46
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 47
0
 void Start()
 {
     Instance = this;
 }
Exemplo n.º 48
0
 void Awake()
 {
     instance = this;
 }
 public void EnableCharacterManager(CombatManager combatManager)
 {
     main = this;
     this.combatManager = combatManager;
 }
Exemplo n.º 50
0
 /// <summary>
 /// Get attackValue ready for combat for specific character.
 /// </summary>
 /// <param name="manager"></param>
 public void Initialize(CombatManager manager)
 {
     this.manager = manager;
     myHealth = manager.GetComponent<CharacterHealth>();
 }
Exemplo n.º 51
0
    public void StartCombat(CombatManager combatManager, CombatInstance combatInstance)
    {
        Assert.IsTrue(IsMine);

        AudioClip prevMusic = combatInstance.GetPreviousMusic(); //FindObjectOfType<GameManager>().GetComponent<MusicManager>().Music.clip;
        AudioClip fightMusic = combatInstance.GetCombatMusic();

        combatManager.Construct(combatInstance);
        PhotonNetwork.Spawn(combatManager.photonView);
    }
Exemplo n.º 52
0
 void Awake()
 {
     //Debug.Log("EventManager::Start()");
     m_EventQueue = new Queue<CombatEvent>();
     m_CombatManager = GetComponent<CombatManager>();
 }
Exemplo n.º 53
0
 void Awake()
 {
     _fsm = new FSM<CombatStates>();
     AddStates();
     AddTransitions();
     _instance = this;
 }
Exemplo n.º 54
0
 void InitializeCombat()
 {
     combatManagerObj = GameObject.FindWithTag("Combat Manager");
     combatManager = combatManagerObj.GetComponent<CombatManager>();
     combatManager.Initialize(currentWorld);
 }