示例#1
0
    public static bool GetActionInput(Player.Character character)
    {
        if (active)
        {
            switch (character)
            {
            case Player.Character.SirYale:
                return(Input.GetButtonDown("Action1"));

                break;

            case Player.Character.SirChubb:
                return(Input.GetButtonDown("Action2"));

                break;

            default:
                return(false);

                break;
            }
        }
        else
        {
            return(false);
        }
    }
示例#2
0
    public static bool active; //Used to disable controls

    public static float GetHorizontalInput(Player.Character character)
    {
        if (active)
        {
            switch (character)
            {
            case Player.Character.SirYale:
                return(Input.GetAxis("Horizontal1"));

                break;

            case Player.Character.SirChubb:
                return(Input.GetAxis("Horizontal2"));

            default:
                return(0);

                break;
            }
        }
        else
        {
            return(0);
        }
    }
    public void GameWon(int controllerNumber, Player.Character chosenCharacter)
    {
        Global.playerWhoWon     = controllerNumber;
        Global.characterThatWon = chosenCharacter;
        Camera.main.GetComponent <AdvancedCamera>().Zoom(Vector2.zero);
        Application.LoadLevel(Global.Screen_WinScreen);

        print("Player " + controllerNumber.ToString() + " won!");
    }
示例#4
0
 public void UseCurrent(Player.Character character, Deck deck)
 {
     if (hand == null)
     {
         return;
     }
     hand[0].Action.useCard(character);
     deck.AddUsedCard(hand[0]);
     hand.RemoveAt(0);
 }
示例#5
0
        //This will return appropriate shop prompts based on metrics
        //passed in the function.
        public List <string> get_prompt(Player.Character chara, string section)
        {
            ShopPromptDC[]      all_prompts      = new ShopPromptDC[0];
            List <ShopPromptDC> possible_prompts = new List <ShopPromptDC>();
            string path = "XmlData/Prompts/";

            switch (chara)
            {
            case Player.Character.Falsael:
                path += "falsael_prompts";
                break;

            case Player.Character.Halephon:
                path += "halephon_prompts";
                break;

            case Player.Character.Petaer:
                path += "petaer_prompts";
                break;

            case Player.Character.Ziktofel:
                path += "ziktofel_prompts";
                break;
            }
            all_prompts = cManager.Load <ShopPromptDC[]>(path);

            for (int i = 0; i < all_prompts.Count(); i++)
            {
                if (String.Compare(all_prompts[i].Shop_Section, section) == 0)
                {
                    possible_prompts.Add(all_prompts[i]);
                }
            }

            int chosen_prompt = rGen.Next(possible_prompts.Count);

            if (possible_prompts.Count > 0)
            {
                return(possible_prompts[chosen_prompt].Prompt_Text);
            }
            else
            {
                return(new List <string>());
            }
        }
    public void ArenaWonBy(Player.Character character)
    {
        switch (character)
        {
        case Player.Character.SirYale:
            ++currentArena;
            break;

        case Player.Character.SirChubb:
            --currentArena;
            break;

        default:
            break;
        }
        if (currentArena == 0 || currentArena == arenaData.Length - 1)
        {
            isFinished = true;
        }
        MoveToArena(currentArena);
    }
示例#7
0
    public void SetCluirichaun(Vector2 pos, int controllerNumber, Player.Character chosenCharacter, GameObject playerObject)
    {
        maxHealth = 7;
        gravity   = 0.5f;
        //gravityCorrection = 0f;
        //resistance = 2f;
        damageMultiplayer  = 1;
        groundRadius       = 0.2f;
        punchShakeHardness = 1.7f;
        jumpShakeHardness  = 1.4f;

        attackCooldownMax   = 30; //50
        maxDrunkness        = 500;
        drunkTimeMultiplier = 300;
        drunkWalkResetTimer = 0;

        velocity      = new Vector2(0, 60);   //0,60
        maxVelocity   = new Vector2(50, 840); //80, 840
        drunkVelocity = new Vector2(0, 0);

        dashType = DashTypes.FORWARD;

        #region DONT EDIT
        //#####################
        //#####DONT EDIT#######
        this.controllerNumber = controllerNumber;
        this.chosenCharacter  = chosenCharacter;
        this.playerObject     = playerObject;

        startingPosition   = pos;
        transform.position = startingPosition;
        SetEntity(startingPosition, true);
        //#####DONT EDIT#######
        //#####################
        #endregion
    }
 public void Open(Player.Character character)
 {
     this.character = character;
     SetNextState(this.states[(int)this.stateID].onOpenStateID);
 }
示例#9
0
 public override void useCard(Player.Character actor)
 {
     Debug.Log("I am Error.");
 }
示例#10
0
 public GameState(Player.Character character)
 {
     this.character = character;
 }
示例#11
0
        protected void spawnObjectUsingPrefabAsModel(int damage, int distance, float deathTime, bool piercing, Util.Enums.Direction direction, float speed, int timesCanPierce, bool isFlying, Grid.GridNode spawnPosition, Player.Character actor)
        {
            Weapons.Hitbox temp  = MonoBehaviour.Instantiate(hitbox);
            GameObject     model = MonoBehaviour.Instantiate(prefab);

            model.transform.parent = temp.transform;
            temp.Damage            = damage;
            temp.Distance          = distance == 0 ? 1 : distance;
            temp.DeathTime         = deathTime;
            temp.Piercing          = piercing;
            temp.Direction         = direction;
            temp.Speed             = speed;
            temp.TimesCanPierce    = timesCanPierce;
            temp.IsFlying          = isFlying;
            temp.Owner             = actor.gameObject;
            temp.Element           = element;
            Util.AddElement.AddElementByEnum(model, element, true);
            temp.CurrentNode        = spawnPosition;
            temp.transform.position = spawnPosition.transform.position;
        }
示例#12
0
 public abstract void useCard(Player.Character actor);
示例#13
0
 public override bool LoadPlayer(Player.Character character)
 {
     _guildRankingManager.ParticipatedPlayers.Add(character.Id);
     return(base.LoadPlayer(character));
 }
示例#14
0
        protected void spawnObjectUsingPrefabAsModel(int damage, int distance, float deathTime, bool piercing, Util.Enums.Direction direction, float speed, int timesCanPierce, bool isFlying, Grid.GridNode spawnPosition, Player.Character actor, bool changeMaterial = false)
        {
            Weapons.Hitbox temp  = MonoBehaviour.Instantiate(hitbox);
            GameObject     model = MonoBehaviour.Instantiate(prefab);

            if (actor.Direction == Util.Enums.Direction.Left)
            {
                model.transform.localScale = new Vector3(model.transform.localScale.x, -model.transform.localScale.y, model.transform.localScale.z);
            }
            model.transform.parent = temp.transform;
            temp.Damage            = damage;
            temp.Distance          = distance == 0 ? 1 : distance;
            temp.DeathTime         = deathTime;
            temp.Piercing          = piercing;
            temp.Direction         = direction;
            temp.Speed             = speed;
            temp.TimesCanPierce    = timesCanPierce;
            temp.IsFlying          = isFlying;
            temp.Owner             = actor.gameObject;
            temp.Element           = element;
            Util.AddElement.AddElementByEnum(temp.gameObject, element, changeMaterial);
            temp.CurrentNode        = spawnPosition;
            temp.transform.position = spawnPosition.transform.position;
        }