public void ClickItem(string quale) { switch (quale) { case "mappa": ToggleMap(); break; default: HomeFlowchart.ExecuteBlock("item-" + quale); break; } }
void Update() { if (flowchart != null && !trackedTargetFound && behaviorTree.GetVariable("Target").GetValue() == trackedTarget) { trackedTargetFound = true; flowchart.ExecuteBlock("Main"); } }
private void OnItemEquipping() { if (flowchart == null && flowchartName != null && flowchartName.Trim().Length != 0) { flowchart = GameObject.Find(flowchartName).GetComponent <Fungus.Flowchart>(); } flowchart.ExecuteBlock(blockName); EventHandler.UnregisterEvent(gameObject, "OnInventoryItemEquipping", OnItemEquipping); }
private void pickPocket() { int pickpocket = Random.Range(1, 9); if (pickpocket >= pickpocketLevel) { storageInventory.ToggleStorage(); } else { Fungus.Flowchart flowchart = GameObject.Find("/Fungus/Flowcharts/Messages/pickpocket_failed").GetComponent <Fungus.Flowchart>(); flowchart.ExecuteBlock("Main"); } }
public override void Interact() { if (m_Interactor != null && flowchart != null) { inProgress = true; flowchart.ExecuteBlock("Start"); if (m_ShouldTurnToInerviewer && navMeshAgent != null && isAlive()) { destination = navMeshAgent.destination; DisableBehavior(); SetDestination(m_InteractorGameObject.transform.position); StartCoroutine(CheckFacingInterviewer()); } Fungus.BlockSignals.OnBlockEnd += OnBlockEnd; } }
private void openLocker() { if (lockLevel > 0 && !IsInCriminalMode()) { Fungus.Flowchart flowchart = GameObject.Find("/Fungus/Flowcharts/Messages/lockpick_requires_criminal_mode").GetComponent <Fungus.Flowchart>(); flowchart.ExecuteBlock("Main"); return; } int lockpick = Random.Range(1, 9); if (lockpick >= lockLevel) { lockLevel = 0; //Now it is inlocked forever storageInventory.ToggleStorage(); } else { Fungus.Flowchart flowchart = GameObject.Find("/Fungus/Flowcharts/Messages/lockpick_failed").GetComponent <Fungus.Flowchart>(); flowchart.ExecuteBlock("Main"); } }
private void OpenLocker() { if (lockLevel > 0 && !IsInCriminalMode()) { Fungus.Flowchart flowchart = GameObject.Find("/Story/Flowcharts/Messages/lockpick_requires_criminal_mode").GetComponent <Fungus.Flowchart>(); flowchart.ExecuteBlock("Main"); return; } int lockpick = Random.Range(1, 9); if (lockpick >= lockLevel) { UnlockForever(); OpenStorage(); } else { Fungus.Flowchart flowchart = GameObject.Find("/Story/Flowcharts/Messages/lockpick_failed").GetComponent <Fungus.Flowchart>(); flowchart.ExecuteBlock("Main"); } }
public bool OnConsumeItem(Item item) { foreach (ItemAttribute attribute in item.itemAttributes) { if ("Health".Equals(attribute.attributeName)) { if ((currentHealth + attribute.attributeValue) > maxHealth) { currentHealth = maxHealth; } else { currentHealth += attribute.attributeValue; } } else if ("Armor".Equals(attribute.attributeName)) { if ((currentArmor + attribute.attributeValue) > maxArmor) { currentArmor = maxArmor; } else { currentArmor += attribute.attributeValue; } } else if ("Damage".Equals(attribute.attributeName)) { if ((currentDamage + attribute.attributeValue) > maxDamage) { currentDamage = maxDamage; } else { currentDamage += attribute.attributeValue; } } else if ("ShotgunAmmo".Equals(attribute.attributeName)) { GameObject currentCharacter = characterSwitch.GetCurrentCharacter(); Opsive.ThirdPersonController.Wrappers.Inventory opsiveInventory = currentCharacter.GetComponent <Opsive.ThirdPersonController.Wrappers.Inventory>(); if (opsiveInventory.HasItem(1650912923)) { opsiveInventory.PickupItem(1548588025, attribute.attributeValue, false, false); } else { Fungus.Flowchart flowchart = GameObject.Find("/Story/Flowcharts/Messages/noSuchWeapon").GetComponent <Fungus.Flowchart>(); flowchart.ExecuteBlock("Main"); return(false); } } else if ("Flowchart".Equals(attribute.attributeName)) { GameObject currentCharacter = characterSwitch.GetCurrentCharacter(); currentCharacter.GetComponentInChildren <StorageInventory>().CloseStorage(); Fungus.Flowchart flowchart = GameObject.Find("/Story/Flowcharts/Items/item" + attribute.attributeValue).GetComponent <Fungus.Flowchart>(); if (flowchart.HasVariable("Interviewer")) { flowchart.SetStringVariable("Interviewer", currentCharacter.tag); } flowchart.ExecuteBlock("Start"); } } return(true); }
private void ShowPickPocketFailedMessage() { Fungus.Flowchart flowchart = GameObject.Find("/Story/Flowcharts/Messages/pickpocket_failed").GetComponent <Fungus.Flowchart>(); flowchart.ExecuteBlock("Main"); }