Ejemplo n.º 1
0
        // Function from file: projectile.dm
        public override dynamic Bump(Ent_Static Obstacle = null, dynamic yes = null)
        {
            int        distance    = 0;
            dynamic    target_turf = null;
            dynamic    permutation = null;
            ByTable    mobs_list   = null;
            Mob_Living L           = null;
            dynamic    picked_mob  = null;


            if (!Lang13.Bool(yes))
            {
                return(null);
            }

            if (Lang13.Bool(this.firer))
            {
                if (Obstacle == this.firer || Obstacle == this.firer.loc && Obstacle is Obj_Mecha)
                {
                    this.loc = Obstacle.loc;
                    return(0);
                }
            }
            distance      = Map13.GetDistance(GlobalFuncs.get_turf(Obstacle), this.starting);
            this.def_zone = GlobalFuncs.ran_zone(this.def_zone, Num13.MaxInt(100 - distance * 7, 5));
            target_turf   = GlobalFuncs.get_turf(Obstacle);
            permutation   = Obstacle.bullet_act(this, this.def_zone);

            if (permutation == -1 || this.forcedodge)
            {
                this.loc = target_turf;

                if (Obstacle != null)
                {
                    this.permutated.Add(Obstacle);
                }
                return(0);
            }
            else if (Obstacle != null && Obstacle.density && !(Obstacle is Mob) && !Lang13.Bool(Obstacle.flags & 512))
            {
                mobs_list = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(target_turf, typeof(Mob_Living)))
                {
                    L = _a;

                    mobs_list.Add(L);
                }

                if (mobs_list.len != 0)
                {
                    picked_mob = Rand13.PickFromTable(mobs_list);
                    ((Ent_Static)picked_mob).bullet_act(this, this.def_zone);
                }
            }
            GlobalFuncs.qdel(this);
            return(null);
        }
Ejemplo n.º 2
0
        // Function from file: weapons.dm
        public override dynamic Bump(Ent_Static Obstacle = null, dynamic yes = null)
        {
            Ent_Static M = null;

            Obstacle.bullet_act(this, this.def_zone);
            this.life -= 10;

            if (Obstacle is Mob)
            {
                M = Obstacle;
                GlobalFuncs.add_logs(this.firer, M, "shot", "" + this);
            }

            if (this.life <= 0)
            {
                GlobalFuncs.qdel(this);
            }
            return(null);
        }