Пример #1
0
        private void TryThrowBatteryMote(ArcBaseRobot robot)
        {
            bool flag = robot == null;

            if (!flag)
            {
                this.timerMoteThrow--;
                bool flag2 = this.timerMoteThrow > 0;
                if (!flag2)
                {
                    this.timerMoteThrow = 300;
                    //float curLevel = robot.needs.rest.CurLevel;
                    float curLevel = robot.needs.TryGetNeed <Need_Battery>().CurLevel;

                    bool flag3 = curLevel > 0.99;
                    if (!flag3)
                    {
                        bool flag4 = curLevel > 0.9;
                        if (flag4)
                        {
                            MoteThrowHelper.ThrowBatteryGreen(base.Position.ToVector3(), base.Map, 0.8f);
                        }
                        else
                        {
                            bool flag5 = curLevel > 0.7;
                            if (flag5)
                            {
                                MoteThrowHelper.ThrowBatteryYellowYellow(base.Position.ToVector3(), base.Map, 0.8f);
                            }
                            else
                            {
                                bool flag6 = curLevel > 0.35;
                                if (flag6)
                                {
                                    MoteThrowHelper.ThrowBatteryYellow(base.Position.ToVector3(), base.Map, 0.8f);
                                }
                                else
                                {
                                    MoteThrowHelper.ThrowBatteryRed(base.Position.ToVector3(), base.Map, 0.8f);
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
 public static Mote ThrowBatteryYellowYellow(Vector3 loc, Map map, float scale)
 {
     return(MoteThrowHelper.ThrowBatteryXYZ(DefDatabase <ThingDef> .GetNamed("Mote_BatteryYellowYellow", true), loc, map, scale));
 }