static public Dialogue_Prompt RequestPayment(Resources_Player player, Resources_Shopkeeper shopkeeper) { int randNum = Random.Range(0, 50); int paymentAmount = shopkeeper.home.payment; // Determine if the shopkeeper is feeling cocky enough to not pay you. if (randNum > shopkeeper.respect && shopkeeper.strength > player.strength) { // The shopkeeper doesn't respect you, and isn't afraid of you, so you are not getting your payment Dialogue_Prompt_Logic.PaymentNone(); return(Dialogue_Prompt.GetPromptByName("dialogue_prompt_paymentNone")); } else { // Check to see if the store can afford to make the payment if (shopkeeper.home.money < paymentAmount) { // If the shop can't afford the payment // Check to see if the shopkeeper is fearful enough to try to pay out of pocket if (shopkeeper.fear > 50) { // The shopkeeper is fearful enought to pay out of pocket // Check to see if the shopkeeper can afford it if (shopkeeper.home.money + shopkeeper.money < paymentAmount) { // The shopkeeper can't make up the difference and must pay only partially player.money += shopkeeper.home.money; shopkeeper.home.money = 0; Dialogue_Prompt_Logic.PaymentPartial(); return(Dialogue_Prompt.GetPromptByName("dialogue_prompt_paymentPartial")); } else { // The shopkeeper will make up the difference out of pocket player.money += paymentAmount; int difAmount = paymentAmount; difAmount -= shopkeeper.home.money; shopkeeper.home.money = 0; shopkeeper.money -= difAmount; Dialogue_Prompt_Logic.PaymentFull(); return(Dialogue_Prompt.GetPromptByName("dialogue_prompt_paymentFull")); } } else { // The shopkeeper is unwilling to pay out of pocket and will pay only partially player.money += shopkeeper.home.money; shopkeeper.home.money = 0; Dialogue_Prompt_Logic.PaymentPartial(); return(Dialogue_Prompt.GetPromptByName("dialogue_prompt_paymentPartial")); } } else { // The shopkeeper can afford the full payment player.money += paymentAmount; shopkeeper.home.money -= paymentAmount; Dialogue_Prompt_Logic.PaymentFull(); return(Dialogue_Prompt.GetPromptByName("dialogue_prompt_paymentFull")); } } }