public override void Use(DealerControler player) { this.Timer = 0; this.Duration = 1; this.maxPlacingRange = 5; this.Placeable = true; this.StopUsage = false; this.DisplayTimer = Duration; this.displayedItem = null; ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0)); if (Physics.Raycast(ray, out hit, 100f, Physics.DefaultRaycastLayers)) { if (hit.transform.gameObject.tag == "Ground") { displayedItem = (GameObject)Instantiate(this.gameObject, new Vector3(hit.point.x, hit.point.y + (this.transform.localScale.y/2), hit.point.z), Quaternion.LookRotation(hit.normal)); donutItem = displayedItem.GetComponent<DonutItem>(); donutItem.inUse = true; donutItem.donutItem = this; } } if (displayedItem == null) { displayedItem = (GameObject)Instantiate(this.gameObject); donutItem = displayedItem.GetComponent<DonutItem>(); donutItem.inUse = true; donutItem.donutItem = this; } }
public override void Use(DealerControler player) { this.maxPlacingRange = 5f; this.wallDistance = 6f; this.Timer = 0; this.Duration = 1; this.Placeable = true; this.DisplayTimer = Duration; this.StopUsage = false; this.displayedItem = null; ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0)); if (Physics.Raycast(ray, out hit, 100f, Physics.DefaultRaycastLayers)) { if (hit.transform.gameObject.tag == "Wall") { displayedItem = (GameObject)Instantiate(this.gameObject, hit.point, Quaternion.LookRotation(hit.normal)); trippingHazardItem = displayedItem.GetComponent<TrippingHazardItem>(); trippingHazardItem.inUse = true; trippingHazardItem.trippingHazardItem = this; } } if (displayedItem == null) { displayedItem = (GameObject)Instantiate(this.gameObject); trippingHazardItem = displayedItem.GetComponent<TrippingHazardItem>(); trippingHazardItem.inUse = true; trippingHazardItem.trippingHazardItem = this; } }
public override void Use(DealerControler player) { this.Duration = 0; this.Timer = 0; this.StopUsage = false; this.Placeable = false; this.DisplayTimer = Duration; GetRandomItem(player); }
public override void UsedUp(DealerControler player) { //foreach (var unit in Players) //{ // unit.GetComponent<PlayerControler>().MinimapDisp.layer = 10; //} //Players = null; player.PlayerControler.MinimapCam.cullingMask &= ~(1 << LayerMask.NameToLayer("Cops")); }
private void AddItemToInv(DealerControler player, Item item) { if (!player.Inventory.HasItem(item)) { player.Inventory.AddItem(item); } else { GetRandomItem(player); } }
public void CheckIfItemInUse(Item item, DealerControler player) { foreach (var piece in this.UsedItems) { if (piece.GetType() == item.GetType()) { piece.UsedUp(player); this.removedItems.Add(piece); } } }
public override void Use(DealerControler player) { this.Timer = 0; this.Duration = 500; this.StopUsage = false; this.Placeable = false; this.DisplayTimer = Duration; this.multiplier = 2; player.PlayerControler.HitingComp.Damage *= multiplier; }
public override void Use(DealerControler player) { this.Timer = 0; this.Duration = 500; this.StopUsage = false; this.Placeable = false; this.DisplayTimer = Duration; this.amor = 100; player.PlayerControler.Amor += amor; }
public override void Use(DealerControler player) { this.StopUsage = false; this.Placeable = false; this.Timer = 0; this.Duration = 0; this.DisplayTimer = Duration; this.healthRegen = 50; player.PlayerControler.Health += healthRegen; if (player.PlayerControler.Health > player.PlayerControler.Character.DefHealth) { player.PlayerControler.Health = player.PlayerControler.Character.DefHealth; } }
public void CheckItemDuration(DealerControler dealer) { if (UsedItems.Count > 0) { foreach (var item in UsedItems) { item.Timer += (item.Placeable) ? 0 : 1; if (item.Timer >= item.Duration) { item.UsedUp(dealer); this.removedItems.Add(item); } } } }
//private PlayerControler[] Players; public override void Use(DealerControler player) { this.Duration = 500; this.Timer = 0; this.StopUsage = false; this.Placeable = false; this.DisplayTimer = Duration; //Players = NetworkManager.FindObjectsOfType<PlayerControler>(); //Debug.Log(Players.Length); //foreach (var unit in Players) //{ // if (unit.tag == "Cop") // { // unit.MinimapDisp.layer = 9; // } //} player.PlayerControler.MinimapCam.cullingMask |= 1 << LayerMask.NameToLayer("Cops"); }
public override void UsedUp(DealerControler player) { }
private void GetRandomItem(DealerControler player) { item = Items[Random.Range(0, Items.Length)].GetComponent<Item>(); AddItemToInv(player, item); }
public abstract void UsedUp(DealerControler player);
public override void UsedUp(DealerControler player) { player.PlayerControler.Amor = player.PlayerControler.Character.BaseAmor; }
private void InitChar() { if (CharacterValue == 1) Character = new Dealer(); else if (CharacterValue == 2) Character = new Redneck(); else if (CharacterValue == 3) Character = new Fatman(); else if (CharacterValue == 4) Character = new Sportsman(); if (Character is Dealer) { for (int i = 0; i < GameManager.Instance.Spawners.Length; i++) { if (GameManager.Instance.Spawners[i].GetComponent<SpawnPoint>().PlayerTag == "Dealer") { this.transform.position = GameManager.Instance.Spawners[i].transform.position; i = GameManager.Instance.Spawners.Length; } } } else { for (int i = 0; i < GameManager.Instance.Spawners.Length; i++) { if (GameManager.Instance.Spawners[i].GetComponent<SpawnPoint>().PlayerTag == "Cop" && GameManager.Instance.Spawners[i].GetComponent<SpawnPoint>().IsUsed == false) { this.transform.position = GameManager.Instance.Spawners[i].transform.position; GameManager.Instance.Spawners[i].GetComponent<SpawnPoint>().IsUsed = true; i = GameManager.Instance.Spawners.Length; } } } this.transform.rotation = Quaternion.identity; this.Character.CharacterMesh.transform.position = this.transforms[0].position; this.Character.CharacterMesh.transform.rotation = this.transforms[0].rotation; Character.Transforms = Instantiate(Character.CharacterMesh).GetComponentsInChildren<Transform>(); Character.Transforms[1].rotation = this.transforms[1].rotation; Character.Transforms[0].parent = this.transforms[0]; Character.Transforms[1].parent = this.transforms[1]; this.Animator = GetComponentInChildren<Animator>(); this.Health = this.Character.DefHealth; this.Speed = this.Character.MovementSpeed; this.Amor = this.Character.BaseAmor; if (this.isLocalPlayer) { mouseLooks[0].enabled = true; mouseLooks[1].enabled = true; CmdSetCharacter(0); } UpdateHealthText(); if (!(this.Character is Dealer)) { if (this.dealerControler != null) this.dealerControler.enabled = false; this.DotRenderer.material.color = Color.blue; this.MinimapDisp.layer = 9; this.gameObject.tag = "Cop"; if (isLocalPlayer) { this.MinimapCam.cullingMask |= 1 << LayerMask.NameToLayer("Cops"); MessageBusManager.AddMessage("CharCreated", new PlayerCreationEventArgs() { IsDealer = false }); } } else { this.dealerControler = this.gameObject.AddComponent<DealerControler>(); this.HitingComp = GetComponentInChildren<Hiting>(); this.DotRenderer.material.color = Color.green; if (isLocalPlayer) this.MinimapCam.cullingMask |= 1 << LayerMask.NameToLayer("Dealer"); this.MinimapDisp.layer = 10; this.gameObject.tag = "Dealer"; } }
public override void UsedUp(DealerControler player) { player.PlayerControler.HitingComp.Damage = player.PlayerControler.Character.BaseDmg; }