public Instance(IStateMachineTarget master, Def def)
     : base(master, def)
 {
     alignment             = master.GetComponent <FactionAlignment>();
     navigator             = master.GetComponent <Navigator>();
     refreshThreatDelegate = RefreshThreat;
 }
Exemple #2
0
            public AttributeModifier baseHeartAttackChance; // базовый шанс

            public Instance(IStateMachineTarget master) : base(master)
            {
                minionIdentity        = master.GetComponent <MinionIdentity>();
                effects               = master.GetComponent <Effects>();
                sicknesses            = master.gameObject.GetSicknesses();
                health                = master.GetComponent <Health>();
                baseHeartAttackChance = new AttributeModifier(ATTRIBUTE_ID, 0, STRINGS.DUPLICANTS.ATTRIBUTES.HEARTATTACKSUSCEPTIBILITY.AGE_MODIFIER, false, false, false);
            }
Exemple #3
0
 public EquipChore(IStateMachineTarget equippable)
     : base(Db.Get().ChoreTypes.Equip, equippable, (ChoreProvider)null, false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.personalNeeds, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this);
     base.smi.sm.equippable_source.Set(equippable.gameObject, base.smi);
     base.smi.sm.requested_units.Set(1f, base.smi);
     showAvailabilityInHoverText = false;
     AddPrecondition(ChorePreconditions.instance.IsAssignedtoMe, equippable.GetComponent <Assignable>());
     AddPrecondition(ChorePreconditions.instance.CanPickup, equippable.GetComponent <Pickupable>());
 }
Exemple #4
0
        public Instance(IStateMachineTarget master)
            : base(master)
        {
            sicknesses         = master.GetComponent <MinionModifiers>().sicknesses;
            primaryElement     = master.GetComponent <PrimaryElement>();
            traits             = master.GetComponent <Traits>();
            lastDiseaseSources = new Dictionary <HashedString, DiseaseSourceInfo>();
            lastExposureTime   = new Dictionary <HashedString, float>();
            inhaleExposureTick = new Dictionary <HashedString, InhaleTickInfo>();
            GameClock.Instance.Subscribe(-722330267, OnNightTime);
            OxygenBreather component = GetComponent <OxygenBreather>();

            component.onSimConsume = (Action <Sim.MassConsumedCallback>)Delegate.Combine(component.onSimConsume, new Action <Sim.MassConsumedCallback>(OnAirConsumed));
        }
 public Instance(IStateMachineTarget master, Def def)
     : base(master, def)
 {
     light         = master.GetComponent <Light2D>();
     originalLux   = light.Lux;
     originalRange = light.Range;
 }
 public Instance(IStateMachineTarget master, GameObject owner)
     : base(master)
 {
     base.sm.owner.Set(owner, base.smi);
     navigator     = owner.GetComponent <Navigator>();
     jet_suit_tank = master.GetComponent <JetSuitTank>();
 }
Exemple #7
0
 public FleeChore(IStateMachineTarget target, GameObject enemy)
     : base(Db.Get().ChoreTypes.Flee, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this);
     base.smi.sm.self.Set(gameObject, base.smi);
     nav = gameObject.GetComponent <Navigator>();
     base.smi.sm.fleeFromTarget.Set(enemy, base.smi);
 }
 public EatChore(IStateMachineTarget master)
     : base(Db.Get().ChoreTypes.Eat, master, master.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.personalNeeds, 5, false, true, 0, false, ReportManager.ReportType.PersonalTime)
 {
     base.smi = new StatesInstance(this);
     showAvailabilityInHoverText = false;
     AddPrecondition(ChorePreconditions.instance.IsNotRedAlert, null);
     AddPrecondition(EdibleIsNotNull, null);
 }
        public Instance(IStateMachineTarget master, Def def)
            : base(master, def)
        {
            KBoxCollider2D component = master.GetComponent <KBoxCollider2D>();

            originalColliderSize   = component.size;
            originalColliderOffset = component.offset;
        }
Exemple #10
0
 public MournChore(IStateMachineTarget master)
     : base(Db.Get().ChoreTypes.Mourn, master, master.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.high, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this);
     AddPrecondition(ChorePreconditions.instance.IsNotRedAlert, null);
     AddPrecondition(ChorePreconditions.instance.NoDeadBodies, null);
     AddPrecondition(HasValidMournLocation, master);
 }
Exemple #11
0
 public ReactEmoteChore(IStateMachineTarget target, ChoreType chore_type, EmoteReactable reactable, HashedString emote_kanim, HashedString[] emote_anims, KAnim.PlayMode play_mode, Func <StatusItem> get_status_item)
     : base(chore_type, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.basic, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     AddPrecondition(ChorePreconditions.instance.IsMoving, null);
     AddPrecondition(ChorePreconditions.instance.IsOffLadder, null);
     AddPrecondition(ChorePreconditions.instance.NotInTube, null);
     AddPrecondition(ChorePreconditions.instance.IsAwake, null);
     getStatusItem = get_status_item;
     base.smi      = new StatesInstance(this, target.gameObject, reactable, emote_kanim, emote_anims, play_mode);
 }
        public Instance(IStateMachineTarget master)
            : base(master)
        {
            Health component = master.GetComponent <Health>();

            if ((bool)component)
            {
                component.CanBeIncapacitated = true;
            }
        }
 public MingleChore(IStateMachineTarget target)
     : base(Db.Get().ChoreTypes.Relax, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.high, 5, false, true, 0, false, ReportManager.ReportType.PersonalTime)
 {
     showAvailabilityInHoverText = false;
     base.smi = new StatesInstance(this, target.gameObject);
     AddPrecondition(HasMingleCell, this);
     AddPrecondition(ChorePreconditions.instance.IsNotRedAlert, null);
     AddPrecondition(ChorePreconditions.instance.IsScheduledTime, Db.Get().ScheduleBlockTypes.Recreation);
     AddPrecondition(ChorePreconditions.instance.CanDoWorkerPrioritizable, this);
 }
 public DirtyVomitChore(
     ChoreType chore_type,
     IStateMachineTarget target,
     StatusItem status_item,
     Notification notification,
     SimUtil.DiseaseInfo diseaseInfo,
     Action <Chore> on_complete = null)
     : base(Db.Get().ChoreTypes.Vomit, target, target.GetComponent <ChoreProvider>(), true, on_complete,
            null, null, PriorityScreen.PriorityClass.compulsory)
 {
     smi = new StatesInstance(this, target.gameObject, status_item, notification, diseaseInfo);
 }
 // Idle Priority 9 puts it above Idle task but below the task the Dupe is finishing
 public FinishMingleChore(IStateMachineTarget target) : base(Db.Get().ChoreTypes.Relax,
                                                             target, target.GetComponent <ChoreProvider>(), false, null, null, null,
                                                             PriorityScreen.PriorityClass.idle, 9, false, true, 0, false,
                                                             ReportManager.ReportType.PersonalTime)
 {
     showAvailabilityInHoverText = false;
     smi = new StatesInstance(this, target.gameObject);
     AddPrecondition(HAS_MINGLE_CELL, this);
     AddPrecondition(ChorePreconditions.instance.IsNotRedAlert, null);
     AddPrecondition(ChorePreconditions.instance.IsScheduledTime, FinishTasksPatches.
                     FinishBlock);
     AddPrecondition(ChorePreconditions.instance.CanDoWorkerPrioritizable, this);
 }
Exemple #16
0
    public SleepChore(ChoreType choreType, IStateMachineTarget target, GameObject bed, bool bedIsLocator, bool isInterruptable)
        : base(choreType, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.personalNeeds, 5, false, true, 0, false, ReportManager.ReportType.PersonalTime)
    {
        base.smi = new StatesInstance(this, target.gameObject, bed, bedIsLocator, isInterruptable);
        if (isInterruptable)
        {
            AddPrecondition(ChorePreconditions.instance.IsNotRedAlert, null);
        }
        AddPrecondition(IsOkayTimeToSleep, null);
        Operational component = bed.GetComponent <Operational>();

        if ((UnityEngine.Object)component != (UnityEngine.Object)null)
        {
            AddPrecondition(ChorePreconditions.instance.IsOperational, component);
        }
    }
 public BeIncapacitatedChore(IStateMachineTarget master)
     : base(Db.Get().ChoreTypes.BeIncapacitated, master, master.GetComponent <ChoreProvider>(), true, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this);
 }
Exemple #18
0
 public BingeEatChore(IStateMachineTarget target, Action <Chore> on_complete = null)
     : base(Db.Get().ChoreTypes.BingeEat, target, target.GetComponent <ChoreProvider>(), false, on_complete, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this, target.gameObject);
     Subscribe(1121894420, OnEat);
 }
Exemple #19
0
 public DieChore(IStateMachineTarget master, Death death)
     : base(Db.Get().ChoreTypes.Die, master, master.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     showAvailabilityInHoverText = false;
     base.smi = new StatesInstance(this, death);
 }
Exemple #20
0
 public Instance(IStateMachineTarget master, Def def)
     : base(master, def)
 {
     operational = master.GetComponent <Operational>();
     _light      = master.GetComponent <Light2D>();
 }
Exemple #21
0
 public Instance(IStateMachineTarget master)
     : base(master)
 {
     choreDriver = master.GetComponent <ChoreDriver>();
 }
Exemple #22
0
 public MoveToQuarantineChore(IStateMachineTarget target, KMonoBehaviour quarantine_area)
     : base(Db.Get().ChoreTypes.MoveToQuarantine, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this, target.gameObject);
     base.smi.sm.locator.Set(quarantine_area.gameObject, base.smi);
 }
Exemple #23
0
 public AttackChore(IStateMachineTarget target, GameObject enemy)
     : base(Db.Get().ChoreTypes.Attack, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.basic, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this);
     base.smi.sm.attackTarget.Set(enemy, base.smi);
 }
Exemple #24
0
 public MoveChore(IStateMachineTarget target, ChoreType chore_type, Func <StatesInstance, int> get_cell_callback, bool update_cell = false)
     : base(chore_type, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this, target.gameObject, get_cell_callback, update_cell);
 }
Exemple #25
0
 public PeeChore(IStateMachineTarget target)
     : base(Db.Get().ChoreTypes.Pee, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this, target.gameObject);
 }
Exemple #26
0
 public Instance(IStateMachineTarget master)
     : base(master)
 {
     sicknesses = master.GetComponent <MinionModifiers>().sicknesses;
 }
 public EmoteChore(IStateMachineTarget target, ChoreType chore_type, HashedString emote_kanim, HashedString[] emote_anims, Func <StatusItem> get_status_item)
     : base(chore_type, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi      = new StatesInstance(this, target.gameObject, emote_kanim, emote_anims, KAnim.PlayMode.Once, false);
     getStatusItem = get_status_item;
 }
 public Instance(IStateMachineTarget master, Def def)
     : base(master, def)
 {
     navigator = master.GetComponent <Navigator>();
 }
 public DropUnusedInventoryChore(ChoreType chore_type, IStateMachineTarget target)
     : base(chore_type, target, target.GetComponent <ChoreProvider>(), true, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.compulsory, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this);
 }
Exemple #30
0
 public DeliverFoodChore(IStateMachineTarget target)
     : base(Db.Get().ChoreTypes.DeliverFood, target, target.GetComponent <ChoreProvider>(), false, (Action <Chore>)null, (Action <Chore>)null, (Action <Chore>)null, PriorityScreen.PriorityClass.basic, 5, false, true, 0, false, ReportManager.ReportType.WorkTime)
 {
     base.smi = new StatesInstance(this);
     AddPrecondition(ChorePreconditions.instance.IsChattable, target);
 }