コード例 #1
0
ファイル: ManaBarUpdater.cs プロジェクト: salesbear/TerraNova
 private void Awake()
 {
     if (player == null)
     {
         player = FindObjectOfType <PlayerAttributes>();
     }
 }
コード例 #2
0
    public override void Apply(PlayerAttributes playerAttributes, TerrainAttributes terrainAttributes)
    {
        TerrainType fairway = terrainAttributes.GetFairwayTerrain();

        fairway.SetLieRate(1f);
        fairway.SetLieRange(0f);
    }
コード例 #3
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.isTrigger)
        {
            return;
        }
        PlayerAttributes attr = collision.GetComponent <PlayerAttributes>();

        if (attr == null)
        {
            return;
        }
        if (attr.health == attr.maxHealth)
        {
            return;
        }
        if (Max)
        {
            attr.health = attr.maxHealth;
        }
        else if (attr.health + Health > attr.maxHealth)
        {
            attr.health = attr.maxHealth;
        }
        else
        {
            attr.health += Health;
        }
        Destroy(this.gameObject);
    }
コード例 #4
0
    public void RemoveEquipEffect(GameObject item)
    {
        player = GameObject.Find("Character");
        pat    = player.GetComponent <PlayerAttributes>();

        //Check through the existing types
        for (int k = 0; k < this.gameObject.GetComponent <ItemController>().items.Count; k++)
        {
            //Check for a match in type
            if (item.name == this.gameObject.GetComponent <ItemController>().items[k].name)
            {
                //Remove the effects from the sorted item
                for (int i = 0; i < this.gameObject.GetComponent <ItemController>().items[k].equipmentEffects.Count; i++)
                {
                    for (int s = 0; s < pat.equippedEffects.Count; s++)
                    {
                        if (pat.equippedEffects[s].name == this.gameObject.GetComponent <ItemController>().items[k].equipmentEffects[i].name)
                        {
                            pat.equippedEffects[s].value = player.GetComponent <PlayerAttributes>().equippedEffects[s].value
                                                           - gameObject.GetComponent <ItemController>().items[k].equipmentEffects[i].value;
                        }
                    }
                }
            }
        }
    }
コード例 #5
0
 void Start()
 {
     //SCRIPT COMPONENTS
     ic  = controller.GetComponent <InventoryController>();
     pat = gameObject.GetComponent <PlayerAttributes>();
     pac = gameObject.GetComponent <PlayerActions>();
 }
コード例 #6
0
ファイル: SharpBlades.cs プロジェクト: WilliamASease/rogolf
    public override void Apply(PlayerAttributes playerAttributes, TerrainAttributes terrainAttributes)
    {
        TerrainType rough = terrainAttributes.GetRoughTerrain();

        rough.SetLieRate(rough.GetLieRate() + 0.10f);
        rough.SetLieRange(rough.GetLieRange() * 0.5f);
    }
コード例 #7
0
    public void AddEquipEffect(string name)
    {
        player = GameObject.Find("Character");
        pat    = player.GetComponent <PlayerAttributes>();

        //Check through the existing types
        for (int k = 0; k < this.gameObject.GetComponent <ItemController>().items.Count; k++)
        {
            //Check for a match in type
            if (name == this.gameObject.GetComponent <ItemController>().items[k].name)
            {
                Debug.Log("Added Equipment Effects [EC: 28]");
                //Check for effects
                for (int i = 0; i < this.gameObject.GetComponent <ItemController>().items[k].equipmentEffects.Count; i++)
                {
                    for (int s = 0; s < pat.equippedEffects.Count; s++)
                    {
                        if (pat.equippedEffects[s].name == this.gameObject.GetComponent <ItemController>().items[k].equipmentEffects[i].name)
                        {
                            pat.equippedEffects[s].value = player.GetComponent <PlayerAttributes>().equippedEffects[s].value
                                                           + this.gameObject.GetComponent <ItemController>().items[k].equipmentEffects[i].value;
                        }
                    }
                }
            }
        }
    }
コード例 #8
0
ファイル: BossBar.cs プロジェクト: Nsyrgame7/MiNET
        private void SendAttributes()
        {
            if (Progress == 0)
            {
                Progress = 1;
            }

            var attributes = new PlayerAttributes
            {
                ["minecraft:health"] = new PlayerAttribute
                {
                    Name     = "minecraft:health",
                    MinValue = 0,
                    MaxValue = MaxProgress,
                    Value    = Progress,
                    Default  = MaxProgress
                }
            };

            var attributesPackate = McpeUpdateAttributes.CreateObject();

            attributesPackate.runtimeEntityId = EntityId;
            attributesPackate.attributes      = attributes;
            Level?.RelayBroadcast(attributesPackate);
        }
コード例 #9
0
ファイル: Enemy.cs プロジェクト: clifordunique/Hunter
    protected void Awake()
    {
        health           = maxHealth;
        Stamina          = maxStamina;
        currentState     = State.Patrol;
        myTransform      = GetComponent <Transform>();
        bodyCollider     = GetComponent <Collider2D>();
        rigidBody        = GetComponent <Rigidbody2D>();
        sprite           = GetComponent <SpriteRenderer>();
        startPos         = myTransform.position;
        playerAttributes = GameObject.FindWithTag("Player").GetComponent <PlayerAttributes>();

        statusBarTransform.TryGetComponent(out StatusBar _bar);
        statusBar           = _bar;
        statusBar.maxHealth = maxHealth;
        statusBar.HealthChange(health);

        foreach (Transform t in transform)
        {
            if (t.tag == "Hook Target")
            {
                myHookTarget = t;
            }
        }

        if (bodyCollider is PolygonCollider2D)
        {
            PolygonCollider2D _col = (PolygonCollider2D)bodyCollider;

            foreach (Vector2 point in _col.points)
            {
                colliderWidth = point.x > colliderWidth ? point.x : colliderWidth;
            }
        }
    }
コード例 #10
0
    private void OnTriggerEnter(Collider colliderObject)
    {
        if (colliderObject.tag == "Player") // Check if player touched it
        {
            // Get access to player stats
            GameObject       player       = colliderObject.gameObject;
            PlayerAttributes playerHealth = player.GetComponent <PlayerAttributes>();

            // Check armour level assigned to pickup
            switch (armourLevel)
            {
            case 1:
                playerHealth.ChangeArmour(25);
                break;

            case 2:
                playerHealth.ChangeArmour(50);
                break;

            case 3:
                playerHealth.ChangeArmour(75);
                break;

            default:     // reset armour to 0
                playerHealth.ChangeArmour(-150);
                break;
            }
            Destroy(gameObject); // Remove from game scene
        }
    }
コード例 #11
0
ファイル: IceCloud.cs プロジェクト: clifordunique/Hunter
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         playerAttributes = collision.GetComponent <PlayerAttributes>();
     }
 }
コード例 #12
0
ファイル: IceCloud.cs プロジェクト: clifordunique/Hunter
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         playerAttributes = null;
     }
 }
コード例 #13
0
 public override void Apply(PlayerAttributes playerAttributes, TerrainAttributes terrainAttributes)
 {
     playerAttributes.SetPower(UnityEngine.Random.Range(0f, 1f));
     playerAttributes.SetControl(UnityEngine.Random.Range(0f, 1f));
     playerAttributes.SetImpact(UnityEngine.Random.Range(0f, 1f));
     playerAttributes.SetSpin(UnityEngine.Random.Range(0f, 1f));
 }
コード例 #14
0
    public void giveReward(PlayerInventory inven, PlayerAttributes attr)
    {
        Item itemToAdd = new HealItem("Potion", 0, itemTypes.HealItem, 10);

        switch (reward)
        {
        case rewards.coins:
            itemToAdd = new Money("CoinBag", rewardAmount, itemTypes.Coin, coinAmount.coinBag);
            break;

        case rewards.potion:
            itemToAdd = new HealItem("Potion", rewardAmount, itemTypes.HealItem, 10);
            break;

        case rewards.poison:
            itemToAdd = new HealItem("Poison", rewardAmount, itemTypes.HealItem, -5);
            break;

        default:
            itemToAdd = new HealItem("Potion", 0, itemTypes.HealItem, 10);
            break;
        }
        inven.addItem(itemToAdd);
        attr.finishQuest(this);
    }
コード例 #15
0
 void Start()
 {
     _playerRigidBody  = GetComponent <Rigidbody2D>();
     _playerAttributes = GetComponent <PlayerAttributes>();
     _playerAnimator   = GetComponent <Animator>();
     _playerCollider2D = GetComponent <BoxCollider2D>();
 }
コード例 #16
0
    public virtual void Initialize(GameObject player)
    {
        stats = player.GetComponent <PlayerStats>();

        if (mutations != null)
        {
            foreach (StatMod mutation in mutations.statMods)
            {
                PlayerAttributes attr = stats.Find(mutation.affectedAttribute.name);
                if (attr != null)
                {
                    attr.AddMod(mutation);
                }
            }


            //// Enumerate through the attributes affected by the mutation on the skill
            //List<PlayerAttributes>.Enumerator attributes = mutation.affectedAttributes.GetEnumerator();
            //while (attributes.MoveNext())
            //{
            //    Debug.Log(attributes.Current.attribute);

            //    PlayerAttributes attr = stats.Find(attributes.Current.attribute.name.ToString());
            //    if (attr !=null)
            //    {
            //        attr.AddMutation(mutation);
            //    }
            //}
        }
    }
コード例 #17
0
 // Start is called before the first frame update
 void Start()
 {
     //ps = flameThrower.GetComponent<ParticleSystem>();
     //ps.Stop();
     //bulletPrefab = bullet1;
     playerStats = gameObject.GetComponent <PlayerAttributes>();
 }
コード例 #18
0
ファイル: SandSaver.cs プロジェクト: WilliamASease/rogolf
    public override void Apply(PlayerAttributes playerAttributes, TerrainAttributes terrainAttributes)
    {
        TerrainType bunker = terrainAttributes.GetBunkerTerrain();

        bunker.SetLieRate(bunker.GetLieRate() + 0.10f);
        bunker.SetLieRange(bunker.GetLieRange() * 0.5f);
    }
コード例 #19
0
        public virtual PlayerAttributes AddHungerAttributes(PlayerAttributes attributes)
        {
            attributes["minecraft:player.hunger"] = new PlayerAttribute
            {
                Name     = "minecraft:player.hunger",
                MinValue = MinHunger,
                MaxValue = MaxHunger,
                Value    = Hunger,
                Default  = MaxHunger,
            };

            attributes["minecraft:player.saturation"] = new PlayerAttribute
            {
                Name     = "minecraft:player.saturation",
                MinValue = 0,
                MaxValue = MaxHunger,
                Value    = (float)Saturation,
                Default  = MaxHunger,
            };
            attributes["minecraft:player.exhaustion"] = new PlayerAttribute
            {
                Name     = "minecraft:player.exhaustion",
                MinValue = 0,
                MaxValue = 5,
                Value    = (float)Exhaustion,
                Default  = 5,
            };

            return(attributes);
        }
コード例 #20
0
    // Update is called once per frame
    void OnTriggerEnter(Collider other)
    {
        if (other.name == tagToTriggerDialog)
        {
            // bring up the window
            GameObject thePlayer = GameObject.Find("Player");
            Debug.Log("player at " + thePlayer.transform.position);
            PlayerAttributes pa = (PlayerAttributes)thePlayer.GetComponent("PlayerAttributes");
            Debug.Log("dialogBox location " + pa.textBoxLocation.transform.position);
            Debug.Log("dialogBox location " + pa.textBoxLocation.transform.localPosition);
            dialogBox.transform.position = pa.textBoxLocation.transform.position;
            //dialogBox.transform.position = pa.textBoxLocation.transform.position;
            TextBoxControl tbc = (TextBoxControl)dialogBox.GetComponent("TextBoxControl");
            tbc.ActivateWindow();

            // pause the game
            Time.timeScale = 0.0001f;

            // destroy if necessary
            if (destroyTriggerAfterReading)
            {
                Destroy(gameObject);
            }
        }
    }
コード例 #21
0
    public void SetNewPlayerAttributes()
    {
        playerAttributes = new PlayerAttributes();

        playerAttributes.experience    = 0;
        playerAttributes.lv            = 1;
        playerAttributes.pointsToSpend = 0;
        playerAttributes.strength      = 1;
        playerAttributes.endurance     = 1;
        playerAttributes.agility       = 1;

        //TODO: REMOVE THIS VALUE. FOR TEST ONLY
        playerAttributes.gold = 99999;

        playerAttributes.townLevel        = 1;
        playerAttributes.townDefCap       = 3;
        playerAttributes.townChanceToKill = 0;

        playerAttributes.equipedWeaponID = 0;

        playerAttributes.inventory = new List <int>();
        playerAttributes.inventory.Add(playerAttributes.equipedWeaponID);

        CalculateNewHealthValue();
        EquipWeapon(playerAttributes.equipedWeaponID);
        CalculateNewMovSpeedValue();

        GameManager.instance.LoadTown();
    }
コード例 #22
0
 public void UpdateTarget(GameObject target)
 {
     other            = target.GetComponent <PhotonView>();
     targetAttributes = target.GetComponent <PlayerAttributes>();
     targetAttributes.BecomeTarget();
     this.photonView.RPC("RPC_UpdateTarget", RpcTarget.All, other.Owner.NickName);
 }
コード例 #23
0
ファイル: Game.cs プロジェクト: WilliamASease/rogolf
    /// <summary>
    /// Performs initialization of Game object.
    /// </summary>
    public void Initialize(GameMode gameMode)
    {
        this.gameMode = gameMode;
        this.state    = new NoState(this);
        gc            = GameObject.Find(GameController.NAME).GetComponent <GameController>();

        // Initialize fields
        this.holeBag           = new HoleBag(gameMode);
        this.itemBag           = new ItemBag("good");
        this.badItemBag        = new ItemBag("bad");
        this.playerAttributes  = new PlayerAttributes();
        this.terrainAttributes = new TerrainAttributes();

        inputController = new InputController(this);
        target          = Target.BALL;

        wind            = new Wind(this);
        ball            = new Ball(this);
        cursor          = new Cursor(this);
        currentDistance = new CurrentDistance(this);
        bag             = new Bag(this);
        powerbar        = new Powerbar(this);
        shotMode        = new ShotMode(this);
        score           = new Score(this);

        // Send Game reference to other objects
        GodOfUI ui = GameObject.Find(GodOfUI.NAME).GetComponent <GodOfUI>();

        ui.gameRef = this;
    }
コード例 #24
0
    private void OnTriggerEnter(Collider col)
    {
        if (col.gameObject.tag.Equals("Player"))
        {
            pa = col.gameObject.GetComponent <PlayerAttributes>();
        }

        if (pa.invulnerableStat == false)
        {
            pa.invulnerableStat  = true;
            pa.invulnerableTimer = 3;
            speedModTimer        = 3;
            pa.StartCoroutine("GetInvulnerable");
            StartCoroutine("SpeedModifier");
            Destroy(gameObject);
            Debug.Log(pa.invulnerableTimer);
        }
        else
        {
            pa.invulnerableTimer += 1;
            speedModTimer        += 1;
            Destroy(gameObject);
            Debug.Log(pa.invulnerableTimer);
        }
    }
コード例 #25
0
 /*
  * Initialization
  */
 void Awake()
 {
     playerAttributes = GetComponent <PlayerAttributes>();
     playerInput      = GetComponent <PlayerInput>();
     playerRigidBody  = GetComponent <Rigidbody>();
     jumpVector       = new Vector3(0f, playerAttributes.jumpHeight, 0f);
 }
コード例 #26
0
ファイル: IceAura.cs プロジェクト: clifordunique/Hunter
 void OnTriggerExit2D(Collider2D col)
 {
     if (col.TryGetComponent(out PlayerAttributes _attributes))
     {
         playerAttributes = null;
     }
 }
コード例 #27
0
 private void Awake()
 {
     _stateController = GetComponentInParent <PlayerStateController>();
     playerMove       = GetComponentInParent <PlayerMovement>();
     player           = GetComponentInParent <PlayerAttributes>();
     cameraScript     = FindObjectOfType <SmoothFollow>();
 }
コード例 #28
0
    private void Awake()
    {
        playerAttributes = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAttributes>();

        // HUD
        SceneManager.LoadScene(6, LoadSceneMode.Additive);
    }
コード例 #29
0
 private void Start()
 {
     attributes        = GetComponent <PlayerAttributes>();
     generator         = particleSource.GetComponent <ParticleGenerator>();
     generator.enabled = false;
     pourTime          = 0;
 }
コード例 #30
0
 public override void Apply(PlayerAttributes playerAttributes, TerrainAttributes terrainAttributes)
 {
     playerAttributes.IncreasePower(UnityEngine.Random.Range(-0.5f, 0.5f));
     playerAttributes.IncreaseControl(UnityEngine.Random.Range(-0.5f, 0.5f));
     playerAttributes.IncreaseImpact(UnityEngine.Random.Range(-0.5f, 0.5f));
     playerAttributes.IncreaseSpin(UnityEngine.Random.Range(-0.5f, 0.5f));
 }
コード例 #31
0
 // Use this for initialization
 public void Start()
 {
     mAccel = new Vector3(0.0f, 0.0f, 0.0f);
     mBody = GetComponent<Rigidbody>();
     mController = GetComponent<UserInputComponent>();
     mAttribs = GetComponent<PlayerAttributes>();
     IsAirborne = false;
 }
コード例 #32
0
ファイル: StartGame.cs プロジェクト: Elzahn/IMY300
    // Use this for initialization
    void Start()
    {
        attributesScript = this.GetComponent<PlayerAttributes> ();
        playerScript = this.GetComponent<PlayerController> ();

        //take this out when gender GUI is replaced
        playerScript.paused = false;
    }
コード例 #33
0
ファイル: Mission.cs プロジェクト: Jellezilla/IsometricSpace
    //protected Player
    // Use this for initialization
    public void Awake()
    {
        target = GameObject.FindGameObjectWithTag("MissionTarget").transform;
        //playerAttributes = GameObject.FindWithTag("Player").transform.GetComponent<PlayerAttributes>();

        playerAttributes = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerAttributes>();
        playerAttributes.activeMissions.Add(this);
        playerAttributes.currentMission = this;
    }
コード例 #34
0
ファイル: CharacterSelection.cs プロジェクト: Elzahn/IMY300
    //    private PlayerController playerScript;
    // Use this for initialization
    void Start()
    {
        GameObject.Find ("Loading Screen").GetComponent<Canvas> ().enabled = false;
        attributesScript = this.GetComponent<PlayerAttributes> ();
        levelUp = GameObject.Find ("LevelUp").GetComponent<ParticleSystem> ();
        levelUp.enableEmission = false;
        levelUp.Clear ();

        //playerScript = this.GetComponent<PlayerController> ();
    }
コード例 #35
0
ファイル: Settings.cs プロジェクト: Elzahn/IMY300
    void Start()
    {
        attributesScript = GameObject.Find ("Player").GetComponent<PlayerAttributes> ();
        narrativeSlider = GameObject.Find ("Slider Narrative").GetComponent<Slider> ();
        soundSlider = GameObject.Find ("Slider Sound").GetComponent<Slider> ();
        difficultySilder = GameObject.Find ("Slider Difficult").GetComponent<Slider> ();

        attributesScript.narrativeShown = 1;
        //1 = easy; 2 = difficult
        attributesScript.difficulty = 1;
        //0 = mute; 1 = on
        attributesScript.soundVolume = 1;
    }
コード例 #36
0
ファイル: PlayerAttributes.cs プロジェクト: dvan3/penance
    // Use this for initialization
    void Awake()
    {
        Instance = this;
        maxHealth = 100;
        curHealth = 100;
        state = 0.5f;
        alive = true;
        rangeDmg = 10;
        meleeDmg = 10;
        TimeToAngel = 8.0f;
        stateTimer = TimeToAngel;
        healthBarLength = Screen.width / 2;
        stateBarLength = healthBarLength;
        penance = PenanceMotion.Instance;

        healthTextures = Resources.LoadAll("Textures/fireoverlay", (typeof(Texture)));
        nextText = false;
        textureIndex = 0;
        numTextures = 90;
    }
コード例 #37
0
ファイル: OpeningCutScene.cs プロジェクト: Elzahn/IMY300
    // Use this for initialization
    void Start()
    {
        player = GameObject.Find("Player");
        attributesScript = player.GetComponent<PlayerAttributes> ();
        player.GetComponent<Sounds> ().stopSound ("all");
        player.GetComponent<Sounds> ().playAmbienceSound (Sounds.SHIP_AMBIENCE);

        movie = (MovieTexture)GameObject.Find ("MovieScreen").GetComponent<Renderer> ().material.mainTexture;// = movie;
        movie.Play();

        movieAudio = GetComponent<AudioSource>();

        if(movieAudio){
            movieAudio.clip = movie.audioClip;

            if(player.GetComponent<PlayerAttributes>().soundVolume == 1){
                movieAudio.Play();
            }
        }
    }
コード例 #38
0
ファイル: Loot.cs プロジェクト: Elzahn/IMY300
 void Start()
 {
     hudText = GameObject.Find ("HUD_Expand_Text").GetComponent<Text> ();
     attributesScript = GameObject.Find("Player").GetComponent<PlayerAttributes> ();
     playerScript = GameObject.Find("Player").GetComponent<PlayerController> ();
     loot = GameObject.Find ("Loot").GetComponent<Canvas> ();
     inventoryHintText = "Keep an eye on your accumulated XP. You can access the inventory by pressing ";
     //loot.enabled = false;
 }
コード例 #39
0
ファイル: LootScrollList.cs プロジェクト: Elzahn/IMY300
    void Start()
    {
        playerAttributes = GameObject.Find ("Player").GetComponent<PlayerAttributes> ();

        rowRectTransform = weaponPrefab.GetComponent<RectTransform>();
        containerRectTransform = gameObject.GetComponent<RectTransform>();

        height = rowRectTransform.rect.height;
        width = 670;

        itemCount = 3;	//set so that it has a starting value

        //adjust the height of the container so that it will just barely fit all its children
        scrollHeight = height * itemCount;

        //maak container groot genoeg om alle items te bevat
        containerRectTransform.offsetMin = new Vector2(containerRectTransform.offsetMin.x, -scrollHeight / 2);
        containerRectTransform.offsetMax = new Vector2(containerRectTransform.offsetMax.x, scrollHeight / 2);
    }
コード例 #40
0
ファイル: Storage.cs プロジェクト: Elzahn/IMY300
    void Start()
    {
        playerAttributes = GameObject.Find ("Player").GetComponent<PlayerAttributes> ();

        storage = GameObject.Find ("StorageText").GetComponent<Text> ();
        /*xp = GameObject.Find ("XPStat").GetComponent<Text> ();
        hp = GameObject.Find ("HPStat").GetComponent<Text> ();
        stamina = GameObject.Find ("StaminaStat").GetComponent<Text> ();
        level = GameObject.Find ("LevelStat").GetComponent<Text> ();*/
        noItems = GameObject.Find ("NoStorageItems").GetComponent<Text> ();

        rowRectTransform = weaponPrefab.GetComponent<RectTransform>();
        containerRectTransform = gameObject.GetComponent<RectTransform>();
        attributesScript = GameObject.Find ("Player").GetComponent<PlayerAttributes> ();

        height = rowRectTransform.rect.height;
        width = 350;

        itemCount = 3;	//set so that it has a starting value

        //adjust the height of the container so that it will just barely fit all its children
        scrollHeight = height * itemCount;

        //maak container groot genoeg om alle items te bevat
        containerRectTransform.offsetMin = new Vector2(containerRectTransform.offsetMin.x, -scrollHeight / 2);
        containerRectTransform.offsetMax = new Vector2(containerRectTransform.offsetMax.x, scrollHeight / 2);
    }
コード例 #41
0
ファイル: PlaceInList.cs プロジェクト: Elzahn/IMY300
 void Start()
 {
     playerAttributes = GameObject.Find ("Player").GetComponent<PlayerAttributes> ();
     //set up in scrollableList line 114 around
 }
コード例 #42
0
ファイル: Equip.cs プロジェクト: Elzahn/IMY300
    void Start()
    {
        containerRectTransform = gameObject.GetComponent<RectTransform>();
        attributesScript = GameObject.Find ("Player").GetComponent<PlayerAttributes> ();

        width = 500;
    }
コード例 #43
0
ファイル: Collisions.cs プロジェクト: Elzahn/IMY300
 void Start()
 {
     showRestore = false;
     hudText = GameObject.Find ("HUD_Expand_Text").GetComponent<Text> ();
     Hud = Camera.main.GetComponent<HUD> ();
     playerAttributesScript = this.GetComponent<PlayerAttributes> ();
     playerScript = this.GetComponent<PlayerController> ();
     totalPieces = 0;
 }
コード例 #44
0
ファイル: BonusObjectives.cs プロジェクト: Elzahn/IMY300
 // Use this for initialization
 void Start()
 {
     attributes = GameObject.Find("Player").GetComponent<PlayerAttributes> ();
     killAllMonstersInGame = false;
     killAllMonstersOnLevel = false;
     reachTheStars = false;
     deadEnemies = 0;
     deadEnemiesOnLevel = 0;
     levelSelect = this.GetComponent<LevelSelect> ();
 }
コード例 #45
0
ファイル: Warping.cs プロジェクト: Elzahn/IMY300
 // Use this for initialization
 void Start()
 {
     temp = false;
     col = null;
     delay = 20;
     waitingForMovement = false;
     chooseDestinationUnlocked = false;	//unlocks at level 6
     chooseDestination = true;
     GameObject.Find("Warp").GetComponent<Canvas>().enabled = false;
     playerScript = GameObject.Find("Player").GetComponent<PlayerController> ();
     attributesScript = GameObject.Find("Player").GetComponent<PlayerAttributes> ();
 }
コード例 #46
0
ファイル: TutorialSpawner.cs プロジェクト: Elzahn/IMY300
    // Use this for initialization
    void Start()
    {
        earthQuake = false;
        attributesScript = GameObject.Find ("Player").GetComponent<PlayerAttributes> ();

        bossPowerCore = new PowerCore ();
        tempLoot = new LinkedList<InventoryItem> ();

        hudText = GameObject.Find ("HUD_Expand_Text").GetComponent<Text> ();

        //addEnemy (enemy1, new Vector3(-9.794984f, 8.99264f, 7.973226f));
        addEnemy (enemy1, new Vector3(-9.79f, 8.99f, 7.97f));
        addEnemy (enemy2, new Vector3(13.43f, 4.87f, -6.02f));

        GameObject.Find ("Player").GetComponent<Sounds> ().playAmbienceSound (Sounds.TUTORIAL_AMBIENCE);
    }
コード例 #47
0
ファイル: StorageScript.cs プロジェクト: Elzahn/IMY300
 void Start()
 {
     attributesScript = GameObject.Find("Player").GetComponent<PlayerAttributes> ();
     storageList = GameObject.Find ("StorageInventoryWeaponScroll").GetComponent<StorageList> ();
     sound = GameObject.Find ("Player").GetComponent<Sounds>();
 }
コード例 #48
0
 void Start()
 {
     playerAttributes = GameObject.Find("Player").GetComponent<PlayerAttributes>();
 }
コード例 #49
0
ファイル: InventoryScript.cs プロジェクト: Elzahn/IMY300
 void Start()
 {
     attributesScript = GameObject.Find("Player").GetComponent<PlayerAttributes> ();
     scrollableList = GameObject.Find ("WeaponScroll").GetComponent<ScrollableList> ();
     sound = GameObject.Find ("Player").GetComponent<Sounds>();
 }
コード例 #50
0
ファイル: LevelSelect.cs プロジェクト: Elzahn/IMY300
 void Start()
 {
     spawnedLevel = false;
     attrs = this.GetComponent<PlayerAttributes>();
 }
コード例 #51
0
ファイル: MenuScript.cs プロジェクト: Elzahn/IMY300
    void Start()
    {
        player = GameObject.Find ("Player");
        attributesScript = player.GetComponent<PlayerAttributes> ();
        loadCanvas = GameObject.Find ("LoadCanvas").GetComponent<Canvas> ();
        saveCanvas = GameObject.Find ("SaveCanvas").GetComponent<Canvas> ();
        settingsCanvas = GameObject.Find ("SettingsCanvas").GetComponent<Canvas> ();
        if(errorPopup == null)
            errorPopup = GameObject.Find ("ErrorPopup");
        errorPopup.SetActive (false);
        player.transform.LookAt(GameObject.Find("Notice board").transform.position);
        player.transform.rotation = Quaternion.Euler (0f, 171.5833f, 0f);
        player.transform.position = new Vector3 (-375.12f, 101.75f, 395.33f);

        soundSet++;

        unequipWeapon();

        if(soundSet == 29){
            //1 = show; 0 = hide
            attributesScript.narrativeShown = 1;
            //1 = easy; 2 = difficult
            attributesScript.difficulty = 1;
            //0 = mute; 1 = on
            attributesScript.soundVolume = 1;

            soundSet = -1;
        }
    }
コード例 #52
0
ファイル: Player.cs プロジェクト: MrGenga/MiNET
		public virtual void SendSetHealth()
		{
			var attributes = new PlayerAttributes();
			attributes["generic.health"] = new PlayerAttribute
			{
				Name = "generic.health", MinValue = 0, MaxValue = 20, Value = HealthManager.Hearts
			};
			attributes["player.hunger"] = new PlayerAttribute
			{
				Name = "player.hunger", MinValue = 0, MaxValue = 20, Value = 15
			};
			attributes["player.level"] = new PlayerAttribute
			{
				Name = "player.level", MinValue = 0, MaxValue = 24791, Value = 0
			};
			attributes["player.experience"] = new PlayerAttribute
			{
				Name = "player.experience", MinValue = 0, MaxValue = 1, Value = 0
			};

			if (Speed == 0.0f) Speed = 0.1f;

			attributes["generic.movementSpeed"] = new PlayerAttribute
			{
				Name = "generic.movementSpeed", MinValue = 0, MaxValue = float.MaxValue, Value = Speed
			};

			McpeUpdateAttributes attributesPackate = McpeUpdateAttributes.CreateObject();
			attributesPackate.entityId = 0;
			attributesPackate.attributes = attributes;
			SendPackage(attributesPackate);
		}
コード例 #53
0
ファイル: SaveSpotTeleport.cs プロジェクト: Elzahn/IMY300
 // Use this for initialization
 void Start()
 {
     showedHealthHint = false;
     loadedTut = false;
     justWarped = false;
     notInUse = true;
     Hud = Camera.main.GetComponent<HUD> ();
     hint = GameObject.Find ("Hint").GetComponent<Image> ();
     interaction = GameObject.Find ("Interaction").GetComponent<Image> ();
     loadTutorial = true;
     canEnterSaveSpot = false;
     showExitConfirmation = false;
     showNoEntry = false;
     showEntranceConfirmation = false;
     attributesComponent = GameObject.Find ("Player").GetComponent<PlayerAttributes> ();
     sound = GameObject.Find ("Player").GetComponent<Sounds> ();
 }
コード例 #54
0
ファイル: Tutorial.cs プロジェクト: Elzahn/IMY300
    void Start()
    {
        if (Application.loadedLevelName == "SaveSpot") {
            GameObject.Find ("Tech Light").GetComponent<Light> ().enabled = false;
            GameObject.Find ("Console Light").GetComponent<Light> ().enabled = false;
            GameObject.Find ("Bedroom Light").GetComponent<Light> ().enabled = false;
        }

        attribteScript = this.GetComponent<PlayerAttributes>();
        this.GetComponent<SaveSpotTeleport> ().canEnterSaveSpot = true;

        moveHintOnScreen = false;
        moveHintOffScreen = false;
        healthHintShown = false;

        health = GameObject.Find ("Health").GetComponent<Image> ();
        stamina = GameObject.Find ("Stamina").GetComponent<Image> ();
        hudText = GameObject.Find ("HUD_Expand_Text").GetComponent<Text> ();
        interaction = GameObject.Find ("Interaction").GetComponent<Image> ();
        hint = GameObject.Find ("Hint").GetComponent<Image> ();
        hintText = GameObject.Find ("Hint_Text").GetComponent<Text> ();
        hintImage = GameObject.Find ("Hint_Image").GetComponent<Image> ();
        sound = GameObject.Find("Player").GetComponent<Sounds>();

        showVisuals = true;
        startTutorial = false;
        tutorialDone = false;
        teachStorage = false;
        teachInventory = false;

        health.enabled = false;
        stamina.enabled = false;

        sarcasm = false;
        sarcasticRemarks = -1;
    }
コード例 #55
0
ファイル: Server.cs プロジェクト: Gamieon/UniNetShooter
    void OnPlayerRegistered(string ID, string playerName)
    {
        Debug.Log("OnPlayerRegistered called. Adding " + playerName + " (" + ID + ") to the list");

        // Add the player to our list
        PlayerAttributes a = new PlayerAttributes();
        a.ID = ID;
        a.PlayerName = playerName;
        playerList.Add(ID, a);

        // Log the connection
        ConsoleDirector.Log(playerName + " has joined the game.");
    }
コード例 #56
0
ファイル: PlayerController.cs プロジェクト: Elzahn/IMY300
    /*public void setJumping(){
        jumping = false;

    }*/
    private void Start()
    {
        MainMenu = GameObject.Find ("MainMenu").GetComponent<Canvas> ();
        MainMenu.enabled = false;
        playerAttributes = GetComponent<PlayerAttributes>();
        paused = false;
        GameObject.Find("Death").GetComponent<Canvas>().enabled = false;
        GameObject.Find("Popup").GetComponent<Canvas>().enabled = false;
        moving = false;
        sound = GetComponent<Sounds>();
    }
コード例 #57
0
ファイル: PlayerAttributes.cs プロジェクト: Elzahn/IMY300
 public void setStartAttributes()
 {
     narrativeShown = 1;
     //1 = easy; 2 = difficult
     difficulty = 1;
     //0 = mute; 1 = on
     soundVolume = 1;
     narrativeSoFar = "";
     showWarpHint = true;
     showLevelUp = false;
     fallFirst = true;
     doorOpen = false;
     //Singleton
     if (instance) {
         DestroyImmediate (gameObject);
         return;
     }
     else {
         DontDestroyOnLoad (gameObject);
         instance = this;
     }
     myAttributes = new AttributeContainer ();
     healthLowering.SetActive (false);
     healthHealing.SetActive (false);
     staminaDrain.SetActive (false);
     healthAltered = 0f;
     staminaDrained = 0f;
     justWarped = false;
     giveAlarm = true;
     gender = '?';
     dizzy = false;
     setInitialXp (0);
     nextRegeneration = Time.time + REGEN_INTERVAL;
     lastDamage = 0;
     CurrentLevel = 0;
 }
コード例 #58
0
ファイル: McpeWriter.cs プロジェクト: TheDiamondYT2/MiNET
		public void Write(PlayerAttributes attributes)
		{
			Write((short)attributes.Count);
			foreach (PlayerAttribute attribute in attributes.Values)
			{
				Write(attribute.MinValue);
				Write(attribute.MaxValue);
				Write(attribute.Value);
				Write(attribute.Name);
			}
		}
コード例 #59
0
ファイル: Enemy.cs プロジェクト: Elzahn/IMY300
    public string attack(PlayerAttributes player)
    {
        GetComponent<Animator>().SetBool("Attacking", true);
        player.lastDamage = Time.time;
        PlayerAttributes.giveAlarm = true;

        float ran = Random.value;
        string message = "Monster Miss! ";

        if (ran <= hitChance){
            message = "Monster Hit! ";
            GameObject.Find("Player").GetComponent<Sounds>().playMonsterSound(Sounds.MONSTER_HIT, this);
            int tmpDamage = damage;
            if (ran <= critChance) {
                tmpDamage *= 2;
                message = "Monster Critical Hit! ";
                GameObject.Find("Player").GetComponent<Sounds>().playMonsterSound(Sounds.MONSTER_CRIT, this);
            }
            player.loseHP(tmpDamage);

            if(message == "Monster Miss! "){
                GameObject.Find("Player").GetComponent<Sounds>().playMonsterSound(Sounds.MONSTER_MISS, this);
            }
        }
        if (GameObject.Find ("Player").GetComponent<PlayerAttributes> ().isDead ()) {
            GameObject.Find("Player").GetComponent<Sounds>().playDeathSound(Sounds.DEAD_MONSTER);
            message += "You died.";
        } else {
            message += player.hp + "/" + player.maxHP();
        }
        //print(message);
        //PlayerLog.addStat (message);
        return message;
    }