private bool consumesItem(ProposalType pt) { if (pt != 0) { return(pt == ProposalType.Marriage); } return(true); }
public void SendProposal(Farmer receiver, ProposalType proposalType, Item gift = null) { Proposal proposal = new Proposal(); proposal.sender.Value = Game1.player; proposal.receiver.Value = receiver; proposal.proposalType.Value = proposalType; proposal.gift.Value = gift; proposals[Game1.player.UniqueMultiplayerID] = proposal; }
internal static bool Prefix(Farmer receiver, ProposalType proposalType, Item gift) { if (proposalType == ProposalType.Gift && gift is GoldItem) { int money = Game1.player.ActiveObject.Stack; sendMoney(receiver, money); Game1.player.removeItemFromInventory(Game1.player.ActiveObject); return(false); } else { return(true); } }
internal static bool Prefix(Farmer receiver, ProposalType proposalType, Item gift) { if (proposalType == ProposalType.Gift && gift is GoldItem) { int money = Game1.player.ActiveObject.Stack; Task.Run(async() => { await PyNet.sendRequestToFarmer <bool>(moneyReceiverName, money, receiver, (b) => { if (!b) { Game1.player.Money += money; } }, SerializationType.PLAIN, 3000); }); Game1.player.removeItemFromInventory(Game1.player.ActiveObject); return(false); } else { return(true); } }
public DiplomaticProposal(int senderFaction, int receiverFaction, ProposalType pType) { this.senderFaction = senderFaction; this.receiverFaction = receiverFaction; this.pType = pType; }