/** * 플레이어가 선택 상자에서 주사하는 명령을 선택하였을 때 실행되는 함수 * \see player::InjectItem */ public void InjectCommand() { Destroy(gObject); player.GetInventoryList().isDialogBoxOn = false; Buff adTemp = new Adrenaline(1); Buff ad = player.FindBuff(adTemp); Buff moTemp = new Morfin(1); Buff mo = player.FindBuff(moTemp); if ((ItemManager.LabelToCategory(player.InventoryList.LabelList[index]) == ItemManager.ItemCategory.AdrenalineDrug && mo != null) || (ItemManager.LabelToCategory(player.InventoryList.LabelList[index]) == ItemManager.ItemCategory.MorfinDrug && ad != null)) { messageMaker.MakeCannotMessage(player.InventoryList.LabelList[index]); return; } messageMaker.MakeItemMessage(MessageMaker.UnitAction.UseItem, player.InventoryList.LabelList[index]); player.UseItem(index); }
private void OnEnable() { m_Target = (target as Adrenaline); if (m_Target != null) { m_Target.DisableShadowCasting(); } m_HealthController = serializedObject.FindProperty("m_HealthController"); m_HealAmount = serializedObject.FindProperty("m_HealAmount"); m_DelayToInject = serializedObject.FindProperty("m_DelayToInject"); m_StaminaBonusDuration = serializedObject.FindProperty("m_StaminaBonusDuration"); m_Amount = serializedObject.FindProperty("m_Amount"); m_InfiniteShots = serializedObject.FindProperty("m_InfiniteShots"); m_MaxAmount = serializedObject.FindProperty("m_MaxAmount"); m_Animator = serializedObject.FindProperty("m_Animator"); m_ShotAnimation = serializedObject.FindProperty("m_ShotAnimation"); m_ShotSound = serializedObject.FindProperty("m_ShotSound"); m_ShotVolume = serializedObject.FindProperty("m_ShotVolume"); }
public void PlaceObject() { Object temp; switch (ObjectListBox.SelectedItem.ToString()) { case "Key": temp = new Key(); PlacedObjectListBox.Items.Add(temp); break; case "Ammo": temp = new Ammo(); PlacedObjectListBox.Items.Add(temp); break; case "Health": temp = new Health(); PlacedObjectListBox.Items.Add(temp); break; case "Adrenaline": temp = new Adrenaline(); PlacedObjectListBox.Items.Add(temp); break; case "Barrel": temp = new Barrel(); PlacedObjectListBox.Items.Add(temp); break; case "Pipe": temp = new Pipe(); PlacedObjectListBox.Items.Add(temp); break; case "Couch": temp = new Couch(); PlacedObjectListBox.Items.Add(temp); break; case "Wardrobe": temp = new Wardrobe(); PlacedObjectListBox.Items.Add(temp); break; case "Lamp": temp = new Lamp(); PlacedObjectListBox.Items.Add(temp); break; case "Desk": temp = new Desk(); PlacedObjectListBox.Items.Add(temp); break; case "Tree": temp = new Tree(); PlacedObjectListBox.Items.Add(temp); break; case "China": temp = new China(); PlacedObjectListBox.Items.Add(temp); break; case "Table": temp = new Table(); PlacedObjectListBox.Items.Add(temp); break; case "Chair": temp = new Chair(); PlacedObjectListBox.Items.Add(temp); break; case "Pistol": temp = new Pistol(); PlacedObjectListBox.Items.Add(temp); break; case "Door": temp = new Door(); PlacedObjectListBox.Items.Add(temp); break; case "Assault Rifle": temp = new AssaultRifle(); PlacedObjectListBox.Items.Add(temp); break; case "Shotgun": temp = new Shotgun(); PlacedObjectListBox.Items.Add(temp); break; case "Rocket Launcher": temp = new RocketLauncher(); PlacedObjectListBox.Items.Add(temp); break; case "Laser Cannon": temp = new LaserCannon(); PlacedObjectListBox.Items.Add(temp); break; case "Player": temp = new Player(); PlacedObjectListBox.Items.Add(temp); break; case "Enemy": temp = new Enemy(); PlacedObjectListBox.Items.Add(temp); break; case "Civilian": temp = new Civilian(); PlacedObjectListBox.Items.Add(temp); break; case "Boss": temp = new Boss(); PlacedObjectListBox.Items.Add(temp); break; case "Cop": temp = new Cop(); PlacedObjectListBox.Items.Add(temp); break; } ; }