Beispiel #1
0
 public override IEnumerable <Gizmo> GetCaravanGizmos(Caravan caravan)
 {
     if (this.CanTradeNow && CaravanVisitUtility.SettlementVisitedNow(caravan) == this)
     {
         yield return(CaravanVisitUtility.TradeCommand(caravan));
     }
     if (CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(caravan, this))
     {
         yield return(FactionGiftUtility.OfferGiftsCommand(caravan, this));
     }
     foreach (Gizmo g in base.GetCaravanGizmos(caravan))
     {
         yield return(g);
     }
     if (this.Attackable)
     {
         yield return(new Command_Action
         {
             icon = SettlementBase.AttackCommand,
             defaultLabel = "CommandAttackSettlement".Translate(),
             defaultDesc = "CommandAttackSettlementDesc".Translate(),
             action = delegate
             {
                 SettlementUtility.Attack(caravan, this.$this);
             }
         });
     }
 }
Beispiel #2
0
 public override IEnumerable <Gizmo> GetCaravanGizmos(Caravan caravan)
 {
     if (CanTradeNow && CaravanVisitUtility.SettlementVisitedNow(caravan) == this)
     {
         yield return(CaravanVisitUtility.TradeCommand(caravan, base.Faction, TraderKind));
     }
     if ((bool)CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(caravan, this))
     {
         yield return(FactionGiftUtility.OfferGiftsCommand(caravan, this));
     }
     foreach (Gizmo caravanGizmo in base.GetCaravanGizmos(caravan))
     {
         yield return(caravanGizmo);
     }
     if (Attackable)
     {
         Command_Action command_Action = new Command_Action();
         command_Action.icon         = AttackCommand;
         command_Action.defaultLabel = "CommandAttackSettlement".Translate();
         command_Action.defaultDesc  = "CommandAttackSettlementDesc".Translate();
         command_Action.action       = delegate
         {
             SettlementUtility.Attack(caravan, this);
         };
         yield return(command_Action);
     }
 }
Beispiel #3
0
        public override IEnumerable <Gizmo> GetCaravanGizmos(Caravan caravan)
        {
            _003CGetCaravanGizmos_003Ec__Iterator1 _003CGetCaravanGizmos_003Ec__Iterator = (_003CGetCaravanGizmos_003Ec__Iterator1) /*Error near IL_0040: stateMachine*/;

            if (CanTradeNow && CaravanVisitUtility.SettlementVisitedNow(caravan) == this)
            {
                yield return((Gizmo)CaravanVisitUtility.TradeCommand(caravan));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if ((bool)CaravanArrivalAction_OfferGifts.CanOfferGiftsTo(caravan, this))
            {
                yield return((Gizmo)FactionGiftUtility.OfferGiftsCommand(caravan, this));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            using (IEnumerator <Gizmo> enumerator = base.GetCaravanGizmos(caravan).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    Gizmo g = enumerator.Current;
                    yield return(g);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            if (Attackable)
            {
                yield return((Gizmo) new Command_Action
                {
                    icon = AttackCommand,
                    defaultLabel = "CommandAttackSettlement".Translate(),
                    defaultDesc = "CommandAttackSettlementDesc".Translate(),
                    action = delegate
                    {
                        SettlementUtility.Attack(caravan, _003CGetCaravanGizmos_003Ec__Iterator._0024this);
                    }
                });

                /*Error: Unable to find new state assignment for yield return*/;
            }
            yield break;
IL_022e:
            /*Error near IL_022f: Unexpected return in MoveNext()*/;
        }
Beispiel #4
0
 public override void Arrived(Caravan caravan)
 {
     SettlementUtility.Attack(caravan, this.settlement);
 }