void Start() { pHud = GetComponent <PlayerHUD>(); death = GetComponent <Death>(); if (photonView.IsMine) { dataManager = GetComponent <PlayerControllerLoader>().inGameDataManager; } // see if the player has the Resilience skill SkillLevel resilienceLevel = GetComponent <PlayerControllerLoader>().skillManager.GetSkillByName("Resilience"); if (resilienceLevel != null) { // they have it, so set it skillModifier = resilienceLevel.Modifier; Debug.Log("Player has Resilience, modifier is: " + skillModifier); } else { Debug.Log("Player does NOT have Resilience"); } currentHealth = (int)(maxHealth * skillModifier); Debug.Log("Player is starting with current health: " + currentHealth); // this may cause problems when we implement the medpack }
void Start() { inGameManager = GetComponent <PlayerControllerLoader>().inGameDataManager; pHud = GetComponent <PlayerHUD>(); inGameManager.OnEquipmentSwitched += EquipmentSwitched; }
public override void Use(InGameDataManager manager) { // use medpack InGamePlayerManager pManager = FindObjectOfType <InGamePlayerManager>(); GameObject myPlayer = null; foreach (var player in pManager.players) { if (player.GetPhotonView().IsMine) { myPlayer = player; } } //myPlayer.GetPhotonView().RPC("StartHeal", RpcTarget.All); float difference = myPlayer.GetComponent <Health>().maxHealth - myPlayer.GetComponent <Health>().currentHealth; myPlayer.GetComponent <Health>().Heal((int)difference); // change the health in the UI as well myPlayer.GetComponent <PlayerHUD>().heal(difference); NotificationSystem.Instance.Notify(new Notification("Used Medpack", NotificationType.Good)); // remove this from the manager manager.currentItem = null; }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); manager = GetComponentInParent <PlayerControllerLoader>().inGameDataManager; manager.OnEquipmentSwitched += EquipmentSwitched; slot = 0; if (Guns.GetChild(slot)) { current = Guns.GetChild(slot); } }
void Start() { currentIndex = -1; sceneManager = GetComponent <PlayerSceneManager>(); inGameManager = GetComponent <InGameDataManager>(); equipment = new Equipment[5]; //equipment[0] = weapons[(int)WeaponType.AR]; equipment[0] = weapons[(int)WeaponType.Pistol]; //weaponCounts[(int)WeaponType.AR]++; weaponCounts[(int)WeaponType.Pistol]++; resources = new List <ResourcePersistent>(); resourceSet = new HashSet <Resource>(); }
void Awake() { GameObject[] objs = GameObject.FindGameObjectsWithTag("GameController"); foreach (var obj in objs) { if (obj.GetPhotonView().Owner.UserId == photonView.Owner.UserId) { playerController = obj; baseDataManager = obj.GetComponent <BaseDataManager>(); inGameDataManager = obj.GetComponent <InGameDataManager>(); sceneManager = obj.GetComponent <PlayerSceneManager>(); skillManager = obj.GetComponent <SkillManager>(); } } sceneManager.isInHomeBase = false; GameControllerSingleton.instance.aliveCount = PhotonNetwork.CurrentRoom.PlayerCount; }
public override void Use(InGameDataManager manager) { InGamePlayerManager pManager = FindObjectOfType <InGamePlayerManager>(); GameObject myPlayer = null; foreach (var player in pManager.players) { if (player.GetPhotonView().IsMine) { myPlayer = player; } } // use energy drink myPlayer.GetComponent <PlayerMotor>().Energize(seconds); NotificationSystem.Instance.Notify(new Notification("Used Energy Drink", NotificationType.Good)); // remove this from the manager? manager.currentItem = null; }
// Update is called once per frame void Update() { if (!photonView.IsMine) { return; } if (gameObject.activeSelf && Input.GetMouseButtonUp(0) && !thrown) { igdm = GetComponentInParent <Transform>().GetComponentInParent <PlayerControllerLoader>().inGameDataManager; Rigidbody rb = gameObject.AddComponent <Rigidbody>() as Rigidbody; rb.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic; thrown = true; Transform angleLooking = GetComponentInParent <Transform>(); GetComponent <Rigidbody>().WakeUp(); GetComponent <Rigidbody>().AddForce(angleLooking.forward * 500); GetComponent <Rigidbody>().useGravity = true; GetComponentInParent <Transform>().parent = null; igdm.currentWeapons[3] = null; igdm.grenadeThrown(); StartCoroutine(Explosion()); r = rb; } }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); manager = GetComponentInParent <PlayerControllerLoader>().inGameDataManager; manager.OnEquipmentSwitched += EquipmentSwitch; }
public abstract void Use(InGameDataManager manager);