Пример #1
0
        // Function from file: dominator.dm
        public override int?process(dynamic seconds = null)
        {
            dynamic domloc = null;
            Gang    G      = null;

            base.process((object)(seconds));

            if (Lang13.Bool(this.gang) && Lang13.Bool(Lang13.IsNumber(this.gang.dom_timer)))
            {
                if (Convert.ToDouble(this.gang.dom_timer) > 0)
                {
                    GlobalFuncs.playsound(this.loc, "sound/items/timer.ogg", 10, 0);

                    if (!this.warned && Convert.ToDouble(this.gang.dom_timer) < 180)
                    {
                        this.warned = true;
                        domloc      = GlobalFuncs.get_area(this.loc);
                        ((Gang)this.gang).message_gangtools("Less than 3 minutes remain in hostile takeover. Defend your dominator at " + domloc.map_name + "!");

                        foreach (dynamic _a in Lang13.Enumerate(GlobalVars.ticker.mode.gangs, typeof(Gang)))
                        {
                            G = _a;


                            if (G != this.gang)
                            {
                                G.message_gangtools("WARNING: " + this.gang.name + " Gang takeover imminent. Their dominator at " + domloc.map_name + " must be destroyed!", true, true);
                            }
                        }
                    }
                }
                else
                {
                    GlobalVars.SSmachine.processing.Remove(this);
                }
            }
            return(null);
        }
Пример #2
0
        // Function from file: dominator.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic tempgang = null;
            double  time     = 0;
            dynamic A        = null;
            dynamic locname  = null;
            Gang    G        = null;


            if (this.operating != 0)
            {
                this.examine(a);
                return(null);
            }

            if (((GameMode)GlobalVars.ticker.mode).get_all_gangsters().Contains(a.mind))
            {
                tempgang = a.mind.gang_datum;
            }
            else
            {
                this.examine(a);
                return(null);
            }

            if (Lang13.Bool(Lang13.IsNumber(tempgang.dom_timer)))
            {
                a.WriteMsg("<span class='warning'>Error: Hostile Takeover is already in progress.</span>");
                return(null);
            }

            if (!(tempgang.dom_attempts != 0))
            {
                a.WriteMsg("<span class='warning'>Error: Unable to breach station network. Firewall has logged our signature and is blocking all further attempts.</span>");
                return(null);
            }
            time = Num13.Round(GlobalFuncs.get_domination_time(tempgang) / 60, 0.1);

            if (Interface13.Alert(a, "With " + Num13.Round(tempgang.territory.len / GlobalVars.start_state.num_territories * 100, 1) + "% station control, a takeover will require " + time + " minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have " + tempgang.dom_attempts + " attempt(s) remaining. Are you ready?", "Confirm", "Ready", "Later") == "Ready")
            {
                if (Lang13.Bool(Lang13.IsNumber(tempgang.dom_timer)) || !(tempgang.dom_attempts != 0) || !(Map13.GetDistance(this, a) <= 1) || !(this.loc is Tile))
                {
                    return(0);
                }
                A         = GlobalFuncs.get_area(this.loc);
                locname   = Lang13.Initial(A, "name");
                this.gang = tempgang;
                this.gang.dom_attempts--;
                GlobalFuncs.priority_announce("Network breach detected in " + locname + ". The " + this.gang.name + " Gang is attempting to seize control of the station!", "Network Alert");
                ((Gang)this.gang).domination();
                this.name = "" + this.gang.name + " Gang " + this.name;
                this.healthcheck(0);
                this.operating = 1;
                GlobalVars.SSmachine.processing.Add(this);
                ((Gang)this.gang).message_gangtools("Hostile takeover in progress: Estimated " + time + " minutes until victory." + (this.gang.dom_attempts != 0 ? "" : " This is your final attempt."));

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.ticker.mode.gangs, typeof(Gang)))
                {
                    G = _a;


                    if (G != this.gang)
                    {
                        G.message_gangtools("Enemy takeover attempt detected in " + locname + ": Estimated " + time + " minutes until our defeat.", true, true);
                    }
                }
            }
            return(null);
        }