コード例 #1
0
	// Use this for initialization
	void Start () {
		playerClass = GameObject.FindObjectOfType<PlayerClass>();
		maxEnergy = playerClass.GetMaxEnergy();

		energyBarImage = GetComponent<Image>();
		playerEnergyText = GetComponentInChildren<Text>();
	}
コード例 #2
0
ファイル: Character.cs プロジェクト: djam-jones/GD-Projects
    void Awake()
    {
        charGender = PlayerGender.Unspecified;

        charClass = PlayerClass.NonSelected;
        charRace = PlayerRace.NonSelected;
    }
コード例 #3
0
    //public GameObject drawn;
	void Awake () {
        facade = GetComponent<SpriteRenderer>();
        facade.sprite = s;
        orig = prefab.transform.position;
        numAnimated = 0;
        pos = new List<Vector3>();
        pos.Add(new Vector3(orig.x-8, orig.y, orig.z)); //L1
        pos.Add(new Vector3(orig.x - 6.5F, orig.y, orig.z)); //L2
        pos.Add(new Vector3(orig.x - 5, orig.y, orig.z));//L3
        pos.Add(new Vector3(orig.x + 8, orig.y, orig.z));//R1
        pos.Add(new Vector3(orig.x + 6.5F, orig.y, orig.z));//R2
        pos.Add(new Vector3(orig.x + 5, orig.y, orig.z));//R3
        pos.Add(new Vector3(orig.x - 3.5F, orig.y, orig.z));//L4
        pos.Add(new Vector3(orig.x + 3.5F, orig.y, orig.z));//R4
        pos.Add(new Vector3(orig.x - 2, orig.y, orig.z));//L5
        pos.Add(new Vector3(orig.x + 2, orig.y, orig.z));//R5
        VictimGenerator v = new VictimGenerator();
        PlayerClass[] p = new PlayerClass[2];
        p[0] = new PlayerClass("PETA player", "insert room name here", 1, "PETA");
        p[1] = new PlayerClass("AARP player", "insert room name here", 1, "AARP");
        d = new Deck(v, 1, p, prefab);
        Debug.Log("The Deck is aware of " + d.affiliations.Length + " distinct player affiliations among " + p.Select(x => x.getAffiliation()).Distinct().Aggregate((i, j) => i + ", " + j));
        foreach (GameObject c in d.cards)
        {
            Debug.Log("The Deck contains " + c.GetComponent<LayeredCardModel>().v.ToString());
        }
    }
コード例 #4
0
 public static string GetClassString(PlayerClass c)
 {
     switch (c)
     {
         case PlayerClass.Scout:
             return SCOUT;
         case PlayerClass.Soldier:
             return SOLDIER;
         case PlayerClass.Pyro:
             return PYRO;
         case PlayerClass.Demoman:
             return DEMOMAN;
         case PlayerClass.Heavy:
             return HEAVY;
         case PlayerClass.Engineer:
             return ENGINEER;
         case PlayerClass.Medic:
             return MEDIC;
         case PlayerClass.Sniper:
             return SNIPER;
         case PlayerClass.Spy:
             return SPY;
         default:
             return "ERR";
     }
 }
コード例 #5
0
 public void PlayerAttackPlayer(PlayerClass attacker, PlayerClass target)
 {
     target.TakeDamage(attacker);
     Debug.Log(target.gameObject.name + " " + target.Percentage);
     if (target.Percentage <= 0)
         fireOnDeathEvent(target);
 }
コード例 #6
0
 public Vote(List<Victim> k, List<Victim> s, int r, PlayerClass[] p)
 {
     killedVictims = k;
     savedVictims = s;
     round = r;
     players = p;
 }
コード例 #7
0
	// Use this for initialization
	void Start () {
		playerClass = GameObject.FindObjectOfType<PlayerClass>();
		maxHealth = playerClass.GetMaxHealth();

		healthBarImage = GetComponent<Image>();
		playerHealthText = GetComponentInChildren<Text>();
	}
コード例 #8
0
ファイル: Player.cs プロジェクト: sampaiodias/Grand-Quest
 public Player()
 {
     name = "Gandalf";
     playerClass = PlayerClass.Mage;
     level = 1;
     expAtual = 0;
     gold = 0;
     attack = 1;
     defense = 1;
     Weapon = new Item();
     Armor = new Item();
     Trinket = new Item();
     Pet = new Item();
     talentLv3 = new Talent();
     talentLv6 = new Talent();
     talentLv9 = new Talent();
     talentLv12 = new Talent();
     talentLv15 = new Talent();
     talentLv18 = new Talent();
     talentLv21 = new Talent();
     talentLv24 = new Talent();
     talentLv27 = new Talent();
     talentLv30 = new Talent();
     LevelExp();
     Eficiences();
     percDecreaseDurationQuest = 0;
     percIncreaseEarnedGold = 0;
 }
コード例 #9
0
ファイル: PlayerDataOld.cs プロジェクト: logicspawn/GTARPG
 public PlayerDataOld()
 {
     Name = "";
     NumberPlate = "";
     Inventory = new List<Item>();
     Weapons = new List<WeaponDefinition>();
     Skills = GM.Copy(SkillRepository.Skills);
     Quests = GM.Copy(QuestRepository.Quests);
     Money = 1000;
     CompletedContracts = 0;
     Motive = PlayerMotive.Rebel;
     Gender = Gender.Male;
     Class = PlayerClass.Time_Master;
     CarColor = VehicleColor.MetallicClassicGold;
     CarSecondaryColor = VehicleColor.MetallicClassicGold;
     SkillSlots = new[]
                 {
                     new SkillSlot {Key = Keys.T},
                     new SkillSlot {Key = Keys.Y},
                     new SkillSlot {Key = Keys.CapsLock},
                     new SkillSlot {Key = Keys.U},
                     new SkillSlot {Key = Keys.B},
                 };
     Setup = new Setup();
     Tutorial = new Tutorial();
     LastContracts = new[] { "","","", "", "" };
     ModelVariations = new Dictionary<int, int>();
 }
コード例 #10
0
ファイル: Trend.cs プロジェクト: NarPar/GGJ2014
    public virtual void ChangeHat(Hat newHat, float transmissionChance, PlayerClass initiator, PlayerClass self)
    {
        if (self != null && self.playerClass == Class.Detective)
        {
          return;
        }

        if (initiator != null && initiator.playerClass == Class.TrendSetter && initiator != self)
          initiator.score += 0.5f;

        // update the current hat
        SetCurrentHat(newHat);
        if(self != null && self.playerClass == Class.BaldMan)
        {
          self.BaldModeOff(); //self.baldMode = false;
        }
        // display swap animation (must be done in main thread)
        AnimTriggerString = "Hat";
        AnimTriggerWaiting = true;

        // trigger local trend
        if (transmissionChance > 0)
          InitiateTrend(newHat, transmissionChance, initiator);

        // initiate hat cooldown
        HatOnCooldown = true;
        HatCooldownTimer.Start();
    }
コード例 #11
0
ファイル: CrowdeeTrend.cs プロジェクト: NarPar/GGJ2014
    public override void ChangeHat(Hat newHat, float transmissionChance, PlayerClass initiator, PlayerClass self)
    {
        if (newHat != CurrentHat)
          StartSameTrendTimer = true;

        base.ChangeHat(newHat, transmissionChance, initiator, self);
        NoActionTimer.Stop();
    }
コード例 #12
0
 public PlayerClass(PlayerClass other)
 {
     this.playerIcon = other.playerIcon;
     this.playerName = other.playerName;
     this.playerID = other.playerID;
     this.playerIcon = other.playerIcon;
     this.playerIconIndex = other.playerIconIndex;
 }
コード例 #13
0
	void Awake () {
		cooldownTimerText = GetComponentInChildren<Text>();
		playerClass = GameObject.FindObjectOfType<PlayerClass>();

		// in awake b/c these componenets are disabled immediately afterwards
		// causing NullReferenceExceptions
		cooldownBackgroundImage = transform.parent.FindChild("Cooldown Background").GetComponent<Image>();
		skillButtonDesign = gameObject.transform.FindChild("Design").GetComponent<Image>();
		skillButtonComponent = GetComponent<Button>();
	}
コード例 #14
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.tag == "Player")
     {
         lastPlayer = collider.transform.GetComponent<PlayerClass>();
         if (lastPlayer != null)
         {
             lastPlayer.saveCheckpoint(pos);
         }
     }
 }
コード例 #15
0
	void Awake () {
		enemyActionBar = GameObject.FindObjectOfType<EnemyActionBar>();
		playerClass = GameObject.FindObjectOfType<PlayerClass>();
		skillButtonControllers = GameObject.FindObjectsOfType<SkillButtonController>();
		enemyMonster = GameObject.FindObjectOfType<EnemyMonster>();

		winBattleResults = GameObject.Find("Win Battle Results");
		loseBattleResults = GameObject.Find("Lose Battle Results");
		winBattleResults.SetActive(false);
		loseBattleResults.SetActive(false);

		levelUpHeader.SetActive(false);
	}
コード例 #16
0
    void EnergyRecoverCalculate()
    {
        GameObject energyHudText = GameObject.Find("EnergyHudText");

        if (remainingSec > 0)
        {
            if (GameObject.Find("EnergyRecoverTimer") == null)
            {
                EnergyRecoverTimer      = GameObject.CreatePrimitive(PrimitiveType.Cube);
                EnergyRecoverTimer.name = "EnergyRecoverTimer";
                EnergyRecoverTimer.AddComponent <TimerWithSpan>();
                EnergyRecoverTimer.GetComponent <TimerWithSpan>().zavTime  = new int[] { 00, 00, remainingSec };
                EnergyRecoverTimer.GetComponent <TimerWithSpan>().targTime = new int[] { 00, 00, 00 };
                EnergyRecoverTimer.GetComponent <TimerWithSpan>().Reset    = false;
                EnergyRecoverTimer.GetComponent <TimerWithSpan>().runTimer = true;
                EnergyRecoverTimer.GetComponent <TimerWithSpan>().zvon.AddListener(() => {
                    energyHudText.GetComponent <Text>().text = "+1";
                    StartCoroutine(PlayerClass.ChangeAttr("energy_bar", 1));
                    Destroy(EnergyRecoverTimer, 0.001f);
                });
            }
        }
        else
        {
            int energyBar    = PlayerPrefs.GetInt("Energy");
            int maxEnergyVal = PlayerClass.GetAttributes()["energy"];

            if (energyBar < maxEnergyVal)
            {
                if (GameObject.Find("EnergyRecoverTimer") == null)
                {
                    EnergyRecoverTimer      = GameObject.CreatePrimitive(PrimitiveType.Cube);
                    EnergyRecoverTimer.name = "EnergyRecoverTimer";
                    EnergyRecoverTimer.AddComponent <TimerWithSpan>();
                    EnergyRecoverTimer.GetComponent <TimerWithSpan>().zavTime  = new int[] { 00, 00, 60 };
                    EnergyRecoverTimer.GetComponent <TimerWithSpan>().targTime = new int[] { 00, 00, 00 };
                    EnergyRecoverTimer.GetComponent <TimerWithSpan>().Reset    = false;
                    EnergyRecoverTimer.GetComponent <TimerWithSpan>().runTimer = true;
                    EnergyRecoverTimer.GetComponent <TimerWithSpan>().zvon.AddListener(() => {
                        energyHudText.GetComponent <Text>().text = "+1";
                        StartCoroutine(PlayerClass.ChangeAttr("energy_bar", 1));
                        Destroy(EnergyRecoverTimer, 0.001f);
                    });
                }
                else
                {
                    remainingSec = int.Parse(EnergyRecoverTimer.GetComponent <TimerWithSpan>().timeString.Substring(6, 2));
                }
            }
        }
    }
コード例 #17
0
    // Use this for initialization
    void Start () {
        //Players 
        a = new PlayerClass("a", "room", 5, "PETA");
        b = new PlayerClass("b", "room", 5, "AARP");
        c = new PlayerClass("c", "room", 5, "NAACP");
        d = new PlayerClass("d", "room", 5, "ALG");
        e = new PlayerClass("e", "room", 5, "CI");
        f = new PlayerClass("f", "room", 5, "EA");
        g = new PlayerClass("g", "room", 5, "NAS");
        h = new PlayerClass("h", "room", 5, "FRAC");
        i = new PlayerClass("i", "room", 5, "NAMBLA");
        VictimGenerator generator = new VictimGenerator();
        generator = new VictimGenerator();
        players  = new PlayerClass[]{ a, b, c, d, e, f, g, h, i};
        v1 = generator.generateVictim();
        v2 = generator.generateVictim();
        v3 = generator.generateVictim();
        v4 = generator.generateVictim();
        v5 = generator.generateVictim();
        v6 = generator.generateVictim();
        v7 = generator.generateVictim();
        v8 = generator.generateVictim();
        v9 = generator.generateVictim();
        v10 = generator.generateVictim();
        v11 = generator.generateVictim();
        v12 = generator.generateVictim();
        v13 = generator.generateVictim();
        v14 = generator.generateVictim();
        v15 = generator.generateVictim();

        List < Victim > k1 = new List<Victim> { v1, v2, v3 };
        List<Victim> k2 = new List<Victim> { v4, v5, v6 };
        List<Victim> k3 = new List<Victim> { v7, v8, v9 };
        List<Victim> k4 = new List<Victim> { v10, v11, v12 };
        List<Victim> k5 = new List<Victim> { v13, v14, v15 };
        List<Victim> s1 = new List<Victim> { v13, v14, v15 };
        List<Victim> s2 = new List<Victim> { v10, v11, v12 };
        List<Victim> s3 = new List<Victim> { v7, v8, v9 };
        List<Victim> s4 = new List<Victim> { v4, v5, v6 };
        List<Victim> s5 = new List<Victim> { v4, v5, v6 };
        //Votes
        Vote vote1 = new Vote(k1, s1, 1, players);
        Vote vote2 = new Vote(k2, s2, 2, players);
        Vote vote3 = new Vote(k3, s3, 3, players);
        Vote vote4 = new Vote(k4, s4, 4, players);
        Vote vote5 = new Vote(k5, s5, 5, players);
        Vote[] votes = new Vote[] { vote1, vote2, vote3, vote4, vote5 };

        Statistics test = new Statistics(votes);
        
    }
コード例 #18
0
    public void CloseShop()
    {
        if (ActivePlayer != null)
        {
            ActivePlayer = null;

            SumOfCosts = 0;
            ConfirmButton.interactable = false;
            CartController.EmptyCart();
            ShopInventoryController.Empty();

            StartCoroutine(CoroutineCloseShop());
        }
    }
コード例 #19
0
	// Use this for initialization
	void Start () {
		world = GameObject.Find("World");
		battle = GameObject.Find("Battle");
		playerMovement = GameObject.FindObjectOfType<PlayerMovement>();
		playerClass = GameObject.FindObjectOfType<PlayerClass>();
		enemySpawnerController = GameObject.FindObjectOfType<EnemySpawnerController>();
		transitionPanel = GameObject.Find("Transition Panel");
		battle.SetActive(false);
		bossStatusController = GameObject.FindObjectOfType<BossStatusController>();
		playerInteractableController = GameObject.FindObjectOfType<PlayerInteractableController>();
		modeTransitionController = GameObject.FindObjectOfType<ModeTransitionController>();
		puzzleObjectController = GameObject.FindObjectOfType<PuzzleObjectController>();
		unityAdsExample = GameObject.FindObjectOfType<UnityAdsExample>();
	}
コード例 #20
0
    // Start is called before the first frame update
    void Start()
    {
        player = GameObject.Find("Player").GetComponent <PlayerClass>();

        textScoreCorrect   = GameObject.Find("Correct").GetComponent <Text>();
        textScoreIncorrect = GameObject.Find("Incorrect").GetComponent <Text>();
        textBasket         = GameObject.Find("Basket").GetComponent <Text>();
        textDialogue       = GameObject.Find("Dialogue").GetComponent <Text>();

        flowerArray = GameObject.FindGameObjectsWithTag("Flower");

        ResetFlowers();
        ClearDialogue();
    }
コード例 #21
0
    public virtual void StartBuff(PlayerClass player)
    {
        PlayerClass = player;
        if (!BuffRunning)
        {
            AbsAmountAdded = BuffAbsAmount + BuffAbsPerLevelAmount * player.playerControl.Level;
            RelAmountAdded = BuffRelAmount + BuffRelPerLevelAmount * player.playerControl.Level;

            PlayerClass.GetAttribute(attribute).AddValue(AbsAmountAdded);
            PlayerClass.GetAttribute(attribute).AddMult(RelAmountAdded);
        }

        Renew();
    }
コード例 #22
0
    //----------------------------------

    // This changes the current player and saves it as default as
    // Well as saving the current PLayers list
    public void ChangePlayer(string name)
    {
        foreach (PlayerClass pc in players)
        {
            if (pc.PlayerName == name)
            {
                currentPlayer = pc;
                PlayerPrefs.SetString("PlayerName", name);
                PlayerName = pc.PlayerName;
                SetPlayerDefaults();
                SavePlayerData();
            }
        }
    }
コード例 #23
0
        internal static Game CreateGame(GameResult result, PlayerClass player, PlayerClass opponent, Deck deck, string archetype)
        {
            var game = new Game();

            game.Deck          = deck;
            game.Result        = result;
            game.PlayerClass   = player;
            game.OpponentClass = opponent;
            game.Note          = new Note()
            {
                Archetype = archetype
            };
            return(game);
        }
コード例 #24
0
    public void DeusVultMode()
    {
        PlayerClass t = new PlayerClass();

        // [ Defensive Options ]
        t.MaximumHealth            = SelectedClass.MaximumHealth;
        t.DamageReduction          = SelectedClass.DamageReduction;
        t.DamageResistance         = SelectedClass.DamageResistance;
        t.LifePerKill              = SelectedClass.LifePerKill;
        t.LifePerSecond            = SelectedClass.LifePerSecond;
        t.CrowdControlReduction    = SelectedClass.CrowdControlReduction;
        t.MaxCrowdControlReduction = SelectedClass.MaxCrowdControlReduction;

        // [ Offensive Options ]
        t.BaseDamage = SelectedClass.BaseDamage;
        t.CritDamage = SelectedClass.CritDamage;
        t.CritChance = SelectedClass.CritChance;

        // [ Magic Options ]
        t.MaximumEnergy             = SelectedClass.MaximumEnergy;
        t.EnergyPerSecond           = SelectedClass.EnergyPerSecond;
        t.CooldownReduction         = SelectedClass.CooldownReduction;
        t.MaximumCooldownReduction  = SelectedClass.MaximumCooldownReduction;
        t.SkillCostReduction        = SelectedClass.SkillCostReduction;
        t.MaximumSkillCostReduction = SelectedClass.MaximumSkillCostReduction;

        // [ Misc  Options ]
        t.MoveSpeed         = SelectedClass.MoveSpeed;
        t.DamageReflection  = SelectedClass.DamageReflection;
        t.CurrentExperience = SelectedClass.CurrentExperience;
        t.Level             = SelectedClass.Level;
        t.MaximumLevel      = SelectedClass.MaximumLevel;

        //t.name = SelectedClass.name;

        t.MaximumHealth = 10000;
        t.MaximumEnergy = 10000;

        t.BaseDamage                = 5000;
        t.CooldownReduction         = 95;
        t.MaximumSkillCostReduction = 95;

        t.EnergyPerSecond = 50;
        t.LifePerSecond   = 50;

        t.CritChance = 100;
        t.CritDamage = 500;

        SelectedClass = t;
    }
コード例 #25
0
    public static Information GetInformation(PlayerClass player)
    {
        switch (player)
        {
        default:
        case PlayerClass.Fighter: return(new Information(1, 1.5f, 110, 9, 11));

        case PlayerClass.Mage: return(new Information(2, 1, 90, 14, 7));

        case PlayerClass.Rogue: return(new Information(0.5f, 2, 80, 6, 14));

        case PlayerClass.Archer: return(new Information(1.5f, 0.5f, 120, 12, 9));
        }
    }
コード例 #26
0
 public static void LoadStatus(PlayerClass characterStats)
 {
     if (PlayerPrefs.HasKey(characterStats.name))
     {
         characterStats.name                  = PlayerPrefs.GetString(characterStats.name);
         characterStats.hp                    = PlayerPrefs.GetInt("HP" + characterStats.name);
         characterStats.experience            = PlayerPrefs.GetInt("Exp" + characterStats.name);
         characterStats.level                 = PlayerPrefs.GetInt("Level" + characterStats.name);
         characterStats.experienceToNextLevel = PlayerPrefs.GetInt("ExpToNextLvl" + characterStats.name);
         characterStats.experiencePoints      = PlayerPrefs.GetInt("ExpPoints" + characterStats.name);
         PlayerClass.ingredients              = PlayerPrefs.GetInt("Ingredients");
         //Debug.Log("Loudou");
     }
 }
コード例 #27
0
    public void SetupGame(int numberOfDeaths, PlayerClass playerclass, Ability[] abilities)
    {
        if (gameSetup)
        {
            return;
        }

        this.numberOfDeaths = numberOfDeaths;

        SelectedClass = playerclass;
        Abilities     = abilities;

        SetupGame();
    }
コード例 #28
0
ファイル: GuardScript.cs プロジェクト: arian8/UnitySimulation
 void OnTriggerExit(Collider col)
 {
     if (col.gameObject.tag == "Player")
     {
         PlayerClass player = col.gameObject.GetComponent <PlayerClass>();
         player.removeImageAbovePlayer();
         if (ismoved)
         {
             agent             = GetComponent <NavMeshAgent>();
             agent.destination = pos1;
             ismoved           = false;
         }
     }
 }
コード例 #29
0
    public void SetItem(PlayerClass player, CraftingController.CraftableItem item, int itemNum)
    {
        if (player.item != null)
        {
            Debug.Log("DSASDA");
            CraftingController.instance.DisableItem(player.item, player.itemNum);
        }

        player.item    = item;
        player.itemNum = itemNum;
        item.gameObject.transform.position = player.playerGO.transform.position;
        item.gameObject.transform.parent   = player.playerGO.transform;
        item.gameObject.SetActive(true);
    }
コード例 #30
0
    [SerializeField] public bool isWarrior  = false; //Holds switch to see if player picks this class

    void Awake()
    {
        ///Singleton
        if (instance == null)
        {
            DontDestroyOnLoad(gameObject);
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
コード例 #31
0
    public void IncDecTimeExt(bool val)
    {
        PlayerClass p = GlobalControl.control.GetCurrentPlayer();

        if (val)
        {
            p.AddTimeExt();
        }
        else if (p.GetTimeExt() > 0)
        {
            p.SubtractTimeExt();
        }

        TimeExtText.text = "5 Sec Time Extensions: " + p.GetTimeExt().ToString();
    }
コード例 #32
0
ファイル: KeyScript.cs プロジェクト: arian8/UnitySimulation
    void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.tag == "Player")
        {
            PlayerClass player = col.gameObject.GetComponent <PlayerClass>();

            player.displayImageAbovePlayer(key_appears);

            player.TargetsList.Remove(GameObject.Find("Target7"));
            player.TargetsList.Remove(GameObject.Find("Target8"));

            player.changeTargetPriority(player.Target_Gate);
            player.changeDest();
        }
    }
コード例 #33
0
 public static Offset <PlayerConfiguration> CreatePlayerConfiguration(FlatBufferBuilder builder,
                                                                      PlayerClass variety_type = PlayerClass.NONE,
                                                                      int varietyOffset        = 0,
                                                                      StringOffset nameOffset  = default(StringOffset),
                                                                      int team = 0,
                                                                      Offset <PlayerLoadout> loadoutOffset = default(Offset <PlayerLoadout>))
 {
     builder.StartObject(5);
     PlayerConfiguration.AddLoadout(builder, loadoutOffset);
     PlayerConfiguration.AddTeam(builder, team);
     PlayerConfiguration.AddName(builder, nameOffset);
     PlayerConfiguration.AddVariety(builder, varietyOffset);
     PlayerConfiguration.AddVarietyType(builder, variety_type);
     return(PlayerConfiguration.EndPlayerConfiguration(builder));
 }
コード例 #34
0
    public void IncDecKeyHint(bool val)
    {
        PlayerClass p = GlobalControl.control.GetCurrentPlayer();

        if (val)
        {
            p.AddKeyHint();
        }
        else if (p.GetKeyHints() > 0)
        {
            p.SubtractKeyHint();
        }

        KeyHintText.text = "Key Hints: " + p.GetKeyHints().ToString();
    }
コード例 #35
0
    public void IncDecReveals(bool val)
    {
        PlayerClass p = GlobalControl.control.GetCurrentPlayer();

        if (val)
        {
            p.AddReveal();
        }
        else if (p.GetReveals() > 0)
        {
            p.SubtractReveal();
        }

        RevealText.text = "Reveals: " + p.GetReveals().ToString();
    }
コード例 #36
0
ファイル: StateWin.cs プロジェクト: bsangston/Blink
 public void Initialize()
 {
     player1     = players[0];
     player2     = players[1];
     player3     = players[2];
     player4     = players[3];
     dummy       = new PlayerClass();
     dummy.score = -100;
     rank        = new PlayerClass[4];
     rankp       = new List <PlayerClass>();
     ranking     = new List <PlayerClass>();
     pos         = new Vector2[4];
     nextState   = null;
     map1        = new Map();
 }
コード例 #37
0
        private void Flush(PlayerClass player)
        {
            switch (player.vt.Flush())
            {
            case VT100.FlushReturnState.Success:
                break;

            case VT100.FlushReturnState.Timeout:
                break;

            case VT100.FlushReturnState.Error:
                RemovePlayer(player);
                throw new PlayerRemovedException();
            }
        }
コード例 #38
0
    public Character(string name, PlayerClass playerClass, PlayerAspect playerAspect, int[] playerAtts, bool male)
    {
        data            = manager.GetComponent <DictionaryDatabase>();
        characterName   = name;
        characterClass  = playerClass;
        characterAspect = playerAspect;
        characterMale   = male;

        for (int i = 0; i < 6; i++)
        {
            baseAtts[i] = playerAtts[i];
        }

        echeLevel = 1;
    }
コード例 #39
0
        public void Switch(PlayerClass playerClass)
        {
            switch (state)
            {
            case State.None:
                state = State.Grabbed;
                playerClass.SetMaximumSpeed(2f);
                break;

            default:
                state = State.None;
                playerClass.SetMaximumSpeed(5f);
                break;
            }
        }
コード例 #40
0
    void Initialisation()
    {
        //todo : import fichier json dans liste
        PlayerClass pl1 = new PlayerClass("Noob1", 12, 3, 9);
        PlayerClass pl2 = new PlayerClass("Noob2", 777, 31, 0);
        PlayerClass pl3 = new PlayerClass("Ariane da best intern", 21, 1000, 1000);

        players.Add(pl1);
        players.Add(pl2);
        players.Add(pl3);

        Input_fields = new List <InputField>();
        Input_fields.Add(Input_nom);
        Input_fields.Add(Input_age);
        Input_fields.Add(Input_force);
        Input_fields.Add(Input_vitesse);

        desactivate_when_empty = new List <GameObject>();
        desactivate_when_empty.Add(ModifButton.gameObject);
        desactivate_when_empty.Add(ChoisirButton.gameObject);
        desactivate_when_empty.Add(age);
        desactivate_when_empty.Add(force);
        desactivate_when_empty.Add(vitesse);
        desactivate_when_empty.Add(combos);
        desactivate_when_empty.Add(profilepic);
        desactivate_when_empty.Add(delete);

        CharButtons = new List <Button>();
        CharButtons.Add(bt1);
        CharButtons.Add(bt2);
        CharButtons.Add(bt3);
        CharButtons.Add(bt4);
        CharButtons.Add(bt5);
        CharButtons.Add(bt6);
        CharButtons.Add(bt7);

        foreach (Button b in CharButtons)
        {
            b.gameObject.SetActive(false);
        }

        under_modification = false;
        under_deletion     = false;
        under_creation     = false;
        normal_mode        = true;

        BackToNormal();
    }
コード例 #41
0
ファイル: Hero.cs プロジェクト: Knoxxt/Systemutveckling
        public Hero(Texture2D texture, Vector2 position, bool isWall, Rectangle hitbox, ReadManager rm, ContentManager content, Texture2D fakeTexture) : base(texture, position, isWall, hitbox)
        {
            // TextureData for pixel collision
            textureData = new Color[fakeTexture.Width * fakeTexture.Height];
            fakeTexture.GetData(textureData);
            // Vectors
            centre         = new Vector2(5, 5);
            savedCombatPos = new Vector2(0, 74);
            // Booleans
            hasJumped      = true;
            attack         = false;
            yourTurn       = true;
            combatMovement = false;
            spell1         = false;
            spell3         = false;
            spell4         = false;
            loadParticles  = true;
            drawParticles  = false;
            // ints and floats
            rotation      = 0;
            acceleration  = 2;
            size          = 1;
            frame         = 3;
            frameTimer    = 100;
            frameInterval = 100;
            // Extra
            rnd             = new Random();
            this.rm         = rm;
            this.content    = content;
            this.fakeHitbox = fakeTexture;
            pClass          = PlayerClass.Mage;

            // Stats
            damage     = 10 + (int)((strength / 10) * rnd.Next(1, 3));
            speed      = 2 + (int)(agility * 0.1);
            level      = 1;
            currentExp = 0;
            maxExp     = 200 + (level * 200);
            skillPoint = 0;
            // Skills
            spell1Rank = 1;
            spell2Rank = 1;
            spell3Rank = 1;
            spell4Rank = 1;
            // Animation
            particleTextures.Add(content.Load <Texture2D>("floor"));
            pe = new ParticleEngine(particleTextures, position + new Vector2(110, 730));
        }
コード例 #42
0
    public override void Initialize(PlayerClass playerWhoThrow)
    {
        this.PlayerWhoThrow = playerWhoThrow;

        if(this.PlayerWhoThrow.Platformer.m_FacingRight != this.isFacingRight)
        {
            Vector3 theScale = this.myObject.transform.localScale;
            theScale.z *= -1;
            this.myObject.transform.localScale = theScale;
        }

        this.myThrowableCollider.enabled = false;
        this.AttackCollider.isTrigger = true;
        this.myRigidbody.isKinematic = true;
        this.SetAttackState(true);
    }
コード例 #43
0
    /*
     * public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId, NetworkReader extraMessagereader)
     * {
     *  PlayerInfoMessage msg = extraMessagereader.ReadMessage<PlayerInfoMessage>();
     *  Debug.Log(msg.playerClass);
     *  GameObject playerPrefab = spawnPlayerFromClass(msg.playerClass);
     *  NetworkServer.AddPlayerForConnection(conn, playerPrefab, playerControllerId);
     * }
     */
    public GameObject spawnPlayerFromClass(PlayerClass playerClass)
    {
        GameObject playerPrefab = null;

        switch (playerClass)
        {
        case PlayerClass.player:
            playerPrefab = playerPrefab;
            break;

        case PlayerClass.camera:
            playerPrefab = cameraPrefab;
            break;
        }
        return(GameObject.Instantiate(playerPrefab, myvectr, Quaternion.identity));
    }
コード例 #44
0
    public void StartMatch(string selectedStage, PlayerClass currentPlayer)
    {
        CurrentMatchClass.availableHints        = 5;
        CurrentMatchClass.currentStage          = "5";
        CurrentMatchClass.playerTokenPosition   = 0;
        CurrentMatchClass.ComputerTokenPosition = 0;

        PlayerPrefs.SetInt("playerToken1Position", 0);
        PlayerPrefs.SetInt("playerToken2Position", 0);
        PlayerPrefs.SetInt("ComputerToken1Position", 0);
        PlayerPrefs.SetInt("ComputerToken2Position", 0);

        Debug.Log("Available Rerolls" + myPlayer.AvailableRerolls + ":" + CurrentMatchClass.availableHints);
        //  Script.matchClass = CurrentMatchClass;
        CurrentMatchClass = new MatchClass(selectedStage, availableHints, playerTokenPosition, ComputerTokenPosition);
    }
コード例 #45
0
 // Start is called before the first frame update
 void Start()
 {
     rigidbody2d          = GetComponent <Rigidbody2D>();
     currentHealth        = maxHealth;
     animator             = GetComponent <Animator>();
     playerClass          = GetComponent <Warrior>();
     chargeEffect         = GetComponent <ParticleSystem>();
     chargeEffectRotation = GetComponent <ParticleSystem>().shape.rotation.z;
     clickHandler         = GetComponent <ClickHandler>();
     spellHandler         = GetComponent <SpellHandler>();
     targetingController  = GetComponent <TargetingController>();
     timeSinceAutoAttack  = attackSpeed;
     lastCharge           = Time.time;
     energyBar            = Camera.main.GetComponentInChildren <EnergyBar>();
     healthBar            = Camera.main.GetComponentInChildren <HealthBar>();
 }
コード例 #46
0
        public EditCharacterClassWindow(PlayerClass _class)
        {
            if (_class != null)
            {
                this._class.CopyValues(_class);
            }

            InitializeComponent();

            ClassDefinition tempClass = ClassList.Find(x => StringComparer.CurrentCultureIgnoreCase.Compare(x.Name, this._class.Name) == 0);

            if (tempClass != null)
            {
                UpdateNotes(tempClass);
            }
        }
コード例 #47
0
    public virtual void UpdateSkill(PlayerClass player)
    {
        CooldownTimer -= Time.deltaTime * player.GetAttributeValue(AttributeType.ATTACKSPEED);
        CooldownTimer  = Mathf.Clamp(CooldownTimer, 0f, SkillCooldown);

        if (Running())
        {
            SkillRunTimer -= Time.deltaTime * player.GetAttributeValue(AttributeType.ATTACKSPEED);
            if (SkillRunTimer <= 0)
            {
                SkillFinished(player);
                skillRunning = false;
                PlayerClass.SkillFinished(this);
            }
        }
    }
コード例 #48
0
	// Update is called once per frame
	void Update () {
		if (!playerClass) {
			playerClass = GameObject.FindObjectOfType<PlayerClass>();
		}

		UpdateStatusEffect();

		if (enableStatusTimer) {
			remainingStatusTime -= Time.deltaTime;

			if (remainingStatusTime <= 0) {
				playerClass.SetCurrentStatus(StatusEffect.None);
				enableStatusTimer = false;
			}
		}
	}
コード例 #49
0
ファイル: GameLoop.cs プロジェクト: PilouProject/Zargos
 public void NextPlayer()
 {
     _indexPlayer++;
     if (_indexPlayer >= Players.Count)
     {
         _indexPlayer = 0;
     }
     if (Players[_indexPlayer].Race == "None")
     {
         NextPlayer();
     }
     else
     {
         CurrentPlayer = Players[_indexPlayer];
     }
 }
コード例 #50
0
    void Awake()
    {
        VictimGenerator v = new VictimGenerator();
        PlayerClass[] p = new PlayerClass[2];
        p[0] = new PlayerClass("PETA player","insert room name here",1, "PETA");
        p[1] = new PlayerClass("AARP player","insert room name here",1, "AARP");
        d = new Deck(v,1,p,prefab);
        //Aggregate((i, j) => i + delimeter + j)
		Debug.Log("The Deck is aware of "+d.affiliations.Length+" distinct player affiliations among "+p.Select(x=>x.getAffiliation()).Distinct().Aggregate((i,j)=>i+", "+j));
        foreach (GameObject c in d.cards)
        {
            Debug.Log("The Deck contains " + c.GetComponent<LayeredCardModel>().v.ToString());
        }

   
 //       Debug.Log("We just drew the first card. It's " + d.draw().GetComponent<LayeredCardModel>().v.ToString());

    }
コード例 #51
0
 /**
  * Set the human class of the alien
  */
 public void SetHumanClass()
 {
     Player playerScript = Player.MyPlayer.GetComponent<Player>();
     switch (humanClassType) {
     case Classes.ENGINEER:
         humanClass = new EngineerClass(playerScript);
         break;
     case Classes.MARINE:
         humanClass = new MarineClass(playerScript);
         break;
     case Classes.SCOUT:
         humanClass = new ScoutClass(playerScript);
         break;
     case Classes.TECHNICIAN:
         humanClass = new TechnicianClass(playerScript);
         break;
     default:
         throw new System.NotSupportedException("Need to assign a valid human class to alien");
     }
 }
コード例 #52
0
	void OnEnable () {
		// TODO create name and summary/description fields for monster

		if (!playerClass) {
			playerClass = GameObject.FindObjectOfType<PlayerClass>();
		}

		monsterImage.sprite = playerClass.GetMonsterSprite();
		nameText.text = playerClass.GetName();
		speciesText.text = playerClass.GetSpecies();
		levelText.text = playerClass.GetPlayerLevel().ToString();

		float expPercentage = playerClass.GetCurrentExperiencePoints() / playerClass.GetExperiencePointsForNextLevel() * 100;
		expThisLevelText.text = expPercentage.ToString() + "%";
		hpText.text = playerClass.GetCurrentHealth().ToString() + " / " + playerClass.GetMaxHealth().ToString();
		epText.text = playerClass.GetCurrentEnergy().ToString() + " / " + playerClass.GetMaxEnergy().ToString();
		baseAttackText.text = playerClass.GetAttackStat().ToString();

		monsterDescription.text = playerClass.GetDescription();

	}
コード例 #53
0
    readonly string assetPath = "Card Sprites";//"Assets/Card Sprites";
    public Deck(VictimGenerator vg, int rounds, PlayerClass[] players, GameObject cardPrefab){
        this.vg = vg;
        numRounds = rounds;
        //Debug.Log("Deck knows all players: " + players.Where(x => x != null).Select(x => x.getName()).Aggregate((c, n) => c + ", " + n));
        //Debug.Log("Deck knows player affiliations: " + players.Where(x => x != null).Select(x => x.getAffiliation()).Aggregate((current, next) => current + "," + next));
        //Debug.Log("Deck knows there are " + rounds + " rounds");
        affiliations = (from player in players select player.getAffiliation()).Distinct().ToArray();
        populateVictims();
        currentRound = 1;
        cards = new GameObject[numRounds*10];
        for (int i = 0; i < cards.Length; i++)
        {
            //TODO: use this PhotonNetwork.Instantiate() method instead once we have a room.
            //cards[i] = PhotonNetwork.Instantiate("CardPrefab", new Vector3(0, 0, 0), new Quaternion(0, 0, 0,0), 1); //only use this in final app
            cards[i]= (GameObject)Instantiate(cardPrefab);
            fillInCardSprites(i);
            cards[i].GetComponent<LayeredCardModel>().v = victims[i];
            generateText(victims[i],cards[i].GetComponent<LayeredCardModel>());
            //Debug.Log("card "+i+" has victim "+cards[i].GetComponent<CardModel>().v.ToString());
            //can dynamically change sprites too!!!!!
        }
	}
コード例 #54
0
ファイル: PlayerController.cs プロジェクト: 302studios/ZeroG
    // Use this for initialization
    void Start()
    {
        playerRigidBody = GetComponent<Rigidbody2D> ();
        myInfo = GetComponent<PlayerClass> ();
        audioPlayer = GetComponent<AudioSource> ();
        theBall = null;

        RegisterInput();

        canJump = true;
        didJump = false;
        grounded = false;
        hasBall = false;
        floatingCheck = true;
        checkStarted = false;
        firstHit = false;
        impulseRate = 15f;

        respawnPoint = this.transform.position;

        spriteHandler.setSprites (myInfo.Data.PlayerCountry);
    }
コード例 #55
0
	void OnEnable () {

		if (Time.realtimeSinceStartup > 5) {
			if (!playerClass) {
				playerClass = GameObject.FindObjectOfType<PlayerClass>();
			}

			if (skill1 == null) {
				skill1 = playerClass.GetSkill1();
				skill2 = playerClass.GetSkill2();
				skill3 = playerClass.GetSkill3();
			}
			if (!skillOneStats) {
				skillOneStats = GameObject.Find("Skill 1 Stats");
			}
			if (!skillTwoStats) {
				skillTwoStats = GameObject.Find("Skill 2 Stats");
			}
			if (!skillThreeStats) {
				skillThreeStats = GameObject.Find("Skill 3 Stats");
			}

		

			if (playerClass.SkillOneUnlocked()) {
				Debug.Log("skill one is unlocked");
				skillOneStats.SetActive(true);

				image1.sprite = skill1.GetSprite();
				nameText1.text = skill1.GetName();
				damageText1.text = skill1.GetBaseDamage().ToString();
				costText1.text = skill1.GetEnergyCost().ToString();
				cooldownText1.text = skill1.GetCooldown().ToString();
				statusEffectText1.text = skill1.GetStatusEffect().ToString();
				chanceText1.text = (skill1.GetChanceOfEffect() * 100).ToString() + "%";
			} else {
				skillOneStats.SetActive(false);
			}


			if (playerClass.SkillTwoUnlocked()) {
				skillTwoStats.SetActive(true);

				image2.sprite = skill2.GetSprite();
				nameText2.text = skill2.GetName();
				damageText2.text = skill2.GetBaseDamage().ToString();
				costText2.text = skill2.GetEnergyCost().ToString();
				cooldownText2.text = skill2.GetCooldown().ToString();
				statusEffectText2.text = skill2.GetStatusEffect().ToString();
				chanceText2.text = (skill2.GetChanceOfEffect() * 100).ToString() + "%";
			} else {
				skillTwoStats.SetActive(false);
			}


			if (playerClass.SkillThreeUnlocked()) {
				skillThreeStats.SetActive(true);

				image3.sprite = skill3.GetSprite();
				nameText3.text = skill3.GetName();
				damageText3.text = skill3.GetBaseDamage().ToString();
				costText3.text = skill3.GetEnergyCost().ToString();
				cooldownText3.text = skill3.GetCooldown().ToString();
				statusEffectText3.text = skill3.GetStatusEffect().ToString();
				chanceText3.text = (skill3.GetChanceOfEffect() * 100).ToString() + "%";
			} else {
				skillThreeStats.SetActive(false);
			}
		}
	}
コード例 #56
0
	void Awake () {
		playerClass = GameObject.FindObjectOfType<PlayerClass>();

	}
コード例 #57
0
 // Use this for initialization
 void Start()
 {
     _player = GameObject.Find("Player").GetComponent<PlayerClass>();
 }
コード例 #58
0
ファイル: Team.cs プロジェクト: MikeJ83/TF2-PUG-Bot
 public void AddPlayer( Player player, PlayerClass desiredClass )
 {
     Players[desiredClass].Add( player );
     this.Skill += player.Skill;
 }
コード例 #59
0
 public string GetImage(PlayerClass @class)
 {
     return _classIcons[@class];
 }
コード例 #60
0
	// Use this for initialization
	void Start () {
		playerClass = GameObject.FindObjectOfType<PlayerClass>();	
		enemyMonster = GameObject.FindObjectOfType<EnemyMonster>();
		eventSystem = GameObject.FindObjectOfType<EventSystem>();
		enemyStatusController = GameObject.FindObjectOfType<EnemyStatusController>();
	}