Exemplo n.º 1
0
 private bool consumesItem(ProposalType pt)
 {
     if (pt != 0)
     {
         return(pt == ProposalType.Marriage);
     }
     return(true);
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 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;
 }