Ejemplo n.º 1
0
        // Function from file: god.dm
        public void trap_construction_ui(Mob_Camera_God user = null)
        {
            string  dat           = null;
            dynamic t             = null;
            dynamic T             = null;
            Icon    I             = null;
            string  img_component = null;
            Browser popup         = null;

            dat = "";

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.global_handofgod_traptypes))
            {
                t = _a;


                if (Lang13.Bool(GlobalVars.global_handofgod_traptypes[t]))
                {
                    T             = GlobalVars.global_handofgod_traptypes[t];
                    dat          += "<center><B>" + GlobalFuncs.capitalize(t) + "</B></center><BR>";
                    I             = new Icon("icons/obj/hand_of_god_structures.dmi", "" + Lang13.Initial(T, "icon_state"));
                    img_component = String13.ToLower(t);
                    Interface13.CacheBrowseResource(user, I, "hog_trap-" + img_component + ".png");
                    dat += "<center><img src='hog_trap-" + img_component + ".png' height=64 width=64></center>";
                    dat += "Description: " + Lang13.Initial(T, "desc") + "<BR>";
                    dat += new Txt("<center><a href='?src=").Ref(this).str(";place_trap=").item(T).str("'>Place ").item(GlobalFuncs.capitalize(t)).str("</a></center><BR><BR>").ToString();
                }
            }
            popup = new Browser(this, "traps", "Place Trap", 350, 500);
            popup.set_content(dat);
            popup.open();
            return;
        }
Ejemplo n.º 2
0
        // Function from file: god.dm
        public void structure_construction_ui(Mob_Camera_God user = null)
        {
            string  dat           = null;
            dynamic t             = null;
            dynamic apath         = null;
            string  imgstate      = null;
            Icon    I             = null;
            string  img_component = null;
            Browser popup         = null;

            dat = "";

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.global_handofgod_structuretypes))
            {
                t = _a;


                if (Lang13.Bool(GlobalVars.global_handofgod_structuretypes[t]))
                {
                    apath         = GlobalVars.global_handofgod_structuretypes[t];
                    dat          += "<center><B>" + GlobalFuncs.capitalize(t) + "</B></center><BR>";
                    imgstate      = (Lang13.Bool(Lang13.Initial(apath, "autocolours")) ? "" + Lang13.Initial(apath, "icon_state") + "-" + this.side : "" + Lang13.Initial(apath, "icon_state"));
                    I             = new Icon("icons/obj/hand_of_god_structures.dmi", imgstate);
                    img_component = String13.ToLower(t);
                    Interface13.CacheBrowseResource(user, I, "hog_structure-" + img_component + ".png");
                    dat += "<center><img src='hog_structure-" + img_component + ".png' height=64 width=64></center>";
                    dat += "Description: " + Lang13.Initial(apath, "desc") + "<BR>";
                    dat += new Txt("<center><a href='?src=").Ref(this).str(";create_structure=").item(apath).str("'>Construct ").item(GlobalFuncs.capitalize(t)).str("</a></center><BR><BR>").ToString();
                }
            }
            popup = new Browser(this, "structures", "Construct Structure", 350, 500);
            popup.set_content(dat);
            popup.open();
            return;
        }
Ejemplo n.º 3
0
 // Function from file: structures.dm
 public override void attack_god(Mob_Camera_God user = null)
 {
     if (user.side == this.side)
     {
         this.pylon_gun.on = !this.pylon_gun.on;
         this.icon_state   = (this.pylon_gun.on ? "defensepylon-" + this.side : "defensepylon");
     }
     return;
 }
 // Function from file: structures.dm
 public override void attack_god(Mob_Camera_God user = null)
 {
     if (user.side == this.side && this.construction_result != null)
     {
         user.add_faith(75);
         this.visible_message(new Txt("<span class='danger'>").item(user).str(" has cancelled ").the(Lang13.Initial(this.construction_result, "name")).item().ToString());
         GlobalFuncs.qdel(this);
     }
     return;
 }
Ejemplo n.º 5
0
 // Function from file: other_mobs.dm
 public Hud_HogGod(Mob_Camera_God owner = null) : base(owner)
 {
     // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
     this.healths = new Obj_Screen_Healths_Deity();
     this.infodisplay.Add(this.healths);
     this.deity_power_display = new Obj_Screen_DeityPowerDisplay();
     this.infodisplay.Add(this.deity_power_display);
     this.deity_follower_display = new Obj_Screen_DeityFollowerDisplay();
     this.infodisplay.Add(this.deity_follower_display);
     return;
 }
        // Function from file: structures.dm
        public override bool assign_deity(Mob_Camera_God new_deity = null, int?alert_old_deity = null)
        {
            alert_old_deity = alert_old_deity ?? GlobalVars.TRUE;


            if (base.assign_deity(new_deity, alert_old_deity))
            {
                this.color = this.side;
            }
            return(false);
        }
Ejemplo n.º 7
0
        // Function from file: structures.dm
        public override bool assign_deity(Mob_Camera_God new_deity = null, int?alert_old_deity = null)
        {
            alert_old_deity = alert_old_deity ?? GlobalVars.TRUE;


            if (base.assign_deity(new_deity, alert_old_deity) && this.pylon_gun != null)
            {
                this.pylon_gun.faction = new ByTable(new object [] { "" + this.side + " god" });
                this.pylon_gun.side    = this.side;
            }
            return(false);
        }
Ejemplo n.º 8
0
        // Function from file: structures.dm
        public override bool assign_deity(Mob_Camera_God new_deity = null, int?alert_old_deity = null)
        {
            alert_old_deity = alert_old_deity ?? GlobalVars.TRUE;


            if (base.assign_deity(new_deity, alert_old_deity))
            {
                this.name = "shrine to " + new_deity.name;
                this.desc = "A shrine dedicated to " + new_deity.name;
            }
            return(false);
        }
Ejemplo n.º 9
0
        // Function from file: objectives.dm
        public override int check_completion(  )
        {
            Mob_Camera_God G = null;

            G = this.owner.current;

            if (G is Mob_Camera_God)
            {
                return(G.prophets_sacrificed_in_name);
            }
            return(0);
        }
Ejemplo n.º 10
0
 // Function from file: items.dm
 public void assign_deity(Mob_Camera_God G = null)
 {
     if (this.speak2god != null)
     {
         if (Lang13.Bool(this.speak2god.owner))
         {
             this.speak2god.Remove(this.speak2god.owner);
         }
     }
     else
     {
         this.speak2god = new Action_Innate_Godspeak();
     }
     this.speak2god.god = G;
     return;
 }
Ejemplo n.º 11
0
        // Function from file: structures.dm
        public override bool assign_deity(Mob_Camera_God new_deity = null, int?alert_old_deity = null)
        {
            alert_old_deity = alert_old_deity ?? GlobalVars.TRUE;


            if (this.deity != null)
            {
                this.deity.conduits.Remove(this);
            }
            base.assign_deity(new_deity, alert_old_deity);

            if (this.deity != null)
            {
                this.deity.conduits.Add(this);
            }
            return(false);
        }
Ejemplo n.º 12
0
        // Function from file: structures.dm
        public virtual bool assign_deity(Mob_Camera_God new_deity = null, int?alert_old_deity = null)
        {
            alert_old_deity = alert_old_deity ?? GlobalVars.TRUE;


            if (!(new_deity != null))
            {
                return(false);
            }

            if (this.deity != null)
            {
                if (Lang13.Bool(alert_old_deity))
                {
                    this.deity.WriteMsg("<span class='danger'><B>Your " + this.name + " was captured by " + new_deity + "'s cult!</B></span>");
                }
                this.deity.structures.Remove(this);
            }
            this.deity = new_deity;
            this.deity.structures.Or(this);
            this.side = this.deity.side;
            this.update_icons();
            return(true);
        }
Ejemplo n.º 13
0
        // Function from file: powers.dm
        public bool ability_cost(int?cost = null, bool?structures = null, bool?requires_conduit = null, bool?can_place_near_enemy_nexus = null)
        {
            cost                       = cost ?? 0;
            structures                 = structures ?? false;
            requires_conduit           = requires_conduit ?? false;
            can_place_near_enemy_nexus = can_place_near_enemy_nexus ?? false;

            dynamic     T     = null;
            Ent_Dynamic AM    = null;
            int         valid = 0;
            Obj_Structure_Divine_Conduit C = null;
            dynamic        enemy           = null;
            Mob_Camera_God enemy_god       = null;


            if ((this.faith ?? 0) < (cost ?? 0))
            {
                this.WriteMsg("<span class='danger'>You lack the faith!</span>");
                return(false);
            }

            if (structures == true)
            {
                if (!(this.loc is Tile) || this.loc is Tile_Space)
                {
                    this.WriteMsg("<span class='danger'>Your structure would just float away, you need stable ground!</span>");
                    return(false);
                }
                T = GlobalFuncs.get_turf(this);

                if (Lang13.Bool(T))
                {
                    if (T.density)
                    {
                        this.WriteMsg("<span class='danger'>There is something blocking your structure!</span>");
                        return(false);
                    }

                    foreach (dynamic _a in Lang13.Enumerate(T, typeof(Ent_Dynamic)))
                    {
                        AM = _a;


                        if (AM == this)
                        {
                            continue;
                        }

                        if (AM.density)
                        {
                            this.WriteMsg("<span class='danger'>There is something blocking your structure!</span>");
                            return(false);
                        }
                    }
                }
            }

            if (requires_conduit == true)
            {
                valid = 0;

                foreach (dynamic _b in Lang13.Enumerate(this.conduits, typeof(Obj_Structure_Divine_Conduit)))
                {
                    C = _b;


                    if (Map13.GetDistance(this, C) <= 15)
                    {
                        valid++;
                        break;
                    }
                }

                if (!(valid != 0))
                {
                    if (Map13.GetDistance(this, this.god_nexus) <= 15)
                    {
                        valid++;
                    }
                }

                if (!(valid != 0))
                {
                    this.WriteMsg("<span class='danger'>You must be near your Nexus or a Conduit to do this!</span>");
                    return(false);
                }
            }

            if (!(can_place_near_enemy_nexus == true))
            {
                enemy = null;

                switch ((string)(this.side))
                {
                case "red":
                    enemy = GlobalVars.ticker.mode.blue_deities[1];
                    break;

                case "blue":
                    enemy = GlobalVars.ticker.mode.red_deities[1];
                    break;
                }

                if (Lang13.Bool(enemy) && GlobalFuncs.is_handofgod_god(enemy.current))
                {
                    enemy_god = enemy.current;

                    if (enemy_god.god_nexus != null && Map13.GetDistance(this, enemy_god.god_nexus) <= 30)
                    {
                        this.WriteMsg("<span class='danger'>You are too close to the other god's stronghold!</span>");
                        return(false);
                    }
                }
            }
            return(true);
        }