Example #1
0
        public GargantuanMinion(Map.World world, PowerContext context, int GargID)
            : base(world, 122305, context.User, null)
        {
            Scale = 1f;
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));

            (Brain as MinionBrain).AddPresetPower(30005);
            (Brain as MinionBrain).AddPresetPower(30001);
            (Brain as MinionBrain).AddPresetPower(30592);
            (Brain as MinionBrain).AddPresetPower(30550);
            Attributes[GameAttribute.Hitpoints_Max_Total]        = 5f;
            Attributes[GameAttribute.Hitpoints_Max]              = 5f;
            Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            Attributes[GameAttribute.Hitpoints_Cur]              = 5f;
            Attributes[GameAttribute.Attacks_Per_Second_Total]   = 1.0f;


            Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]   = 5f;
            Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = 7f;

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = GargID,
                PetId  = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #2
0
        public Projectile(PowerContext context, int actorSNO, Vector3D position)
            : base(context.World, actorSNO)
        {
            this.Field2 = 0x8;
            this.Scale = 1.35f;
            // just use default? GBHandle.Projectile is 10, but most projectiles I see use 17
            //this.GBHandle.Type = (int)GBHandleType.Projectile; this.GBHandle.GBID = 1;
            this.Field7 = 0x00000001;
            // these no longer needed?
            //this.Field10 = 0x1;
            //this.Field11 = 0x1;
            //this.Field12 = 0x1;
            //this.Field13 = 0x1;
            //this.CollFlags = 0x4;
            
            this.Context = context;
            this.Position = new Vector3D(position);
            this.Timeout = new SecondsTickTimer(context.World.Game, 2f);  // 2 second default timeout for projectiles

            // copy in important effect params from user
            this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO];

            _arrivalTime = null;
            _lastUpdateTick = 0;
            _prevUpdatePosition = null;
            _onArrivalCalled = false;

            // offset position by mpq collision data
            this.Position.Z += this.ActorData.Cylinder.Ax1 - this.ActorData.Cylinder.Position.Z;
        }
Example #3
0
        //female ->123885
        //male -> 169904

        public MysticAllyMinion(Map.World world, PowerContext context, int MysticAllyID)
            : base(world, 123885, context.User, null)
        {
            Scale = 1.35f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            (Brain as MinionBrain).AddPresetPower(169081); //melee_instant
            (Brain as MinionBrain).AddPresetPower(169155); //Rune_aKick
            (Brain as MinionBrain).AddPresetPower(169325); //Rune_bWaveAttack
            (Brain as MinionBrain).AddPresetPower(169715); //Rune_cGroundPunch
            (Brain as MinionBrain).AddPresetPower(169728); //Rune_dAoeAttack
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max_Total]        = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Hitpoints_Max_Total];
            Attributes[GameAttribute.Hitpoints_Max]              = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Hitpoints_Max_Total];
            Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            Attributes[GameAttribute.Hitpoints_Cur]              = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Hitpoints_Max_Total];
            Attributes[GameAttribute.Attacks_Per_Second_Total]   = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = context.ScriptFormula(1);
            //Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = MysticAllyID,
                PetId  = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #4
0
        public AcidCloudSlime(Map.World world, PowerContext context, int SlimeID)
            : base(world, 120950, context.User, null)
        {
            Scale = 1.2f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max_Total]        = 20f;
            Attributes[GameAttribute.Hitpoints_Max]              = 20f;
            Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            Attributes[GameAttribute.Hitpoints_Cur]              = 20f;
            Attributes[GameAttribute.Attacks_Per_Second_Total]   = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]   = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = SlimeID,
                PetId  = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #5
0
        //107031, 106731, 106749, 107067, 107107, 107112

        public CorpseSpider(Map.World world, PowerContext context, int SpiderID)
            : base(world, 107031, context.User, null)
        {
            Scale = 1.2f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            (Brain as MinionBrain).AddPresetPower(30592); //melee_instant
            (Brain as MinionBrain).AddPresetPower(30005); //AINearby
            (Brain as MinionBrain).AddPresetPower(107103); //Spider_leap
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max_Total] = 20f;
            Attributes[GameAttribute.Hitpoints_Max] = 20f;
            Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            Attributes[GameAttribute.Hitpoints_Cur] = 20f;
            Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = context.ScriptFormula(16) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = context.ScriptFormula(17) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = SpiderID,
                PetId = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #6
0
        //Changes creature with each rune,
        //RuneSelect(133741, 173827, 181748, 159098, 159102, 159144)

        public CompanionMinion(Map.World world, PowerContext context, int CompanionID)
            : base(world, 133741, context.User, null)
        {
            Scale = 1.2f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            (Brain as MinionBrain).AddPresetPower(169081); //melee_instant
            (Brain as MinionBrain).AddPresetPower(133887); //ChargeAttack
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max] = 20f;
            Attributes[GameAttribute.Hitpoints_Cur] = 20f;
            Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = CompanionID,
                PetId = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #7
0
        private bool _spawned;  // using my own spawn flag cause Actor.Spawned isn't being used right now

        public Projectile(PowerContext context, int actorSNO, Vector3D position)
            : base(context.World, actorSNO)
        {
            this.Field2 = 0x8;
            this.Field7 = 0x00000001;  // TODO: test if this is necessary

            if (this.Scale == 0f)
                this.Scale = 1.00f;

            this.Context = context;
            this.Position = new Vector3D(position);
            // offset position by mpq collision data
            this.Position.Z += this.ActorData.Cylinder.Ax1 - this.ActorData.Cylinder.Position.Z;
            // 2 second default timeout for projectiles
            this.Timeout = new SecondsTickTimer(context.World.Game, 2f);

            // copy in important effect params from user
            this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO];

            _prevUpdatePosition = null;
            _mover = new ActorMover(this);
            _spawned = false;
        }
Example #8
0
        public ZombieDog(Map.World world, PowerContext context, int dogID)
            : base(world, 51353, context.User, null)
        {
            Scale = 1.35f;
            //TODO: get a proper value for this.
            this.WalkSpeed *= 3;
            SetBrain(new MinionBrain(this));
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max]      = 20f;
            Attributes[GameAttribute.Hitpoints_Cur]      = 20f;
            Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min, 0]   = 5f;
            Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = dogID,
                PetId  = this.DynamicID,
                Field3 = 0x8,
            });
        }
 public ImpressionsController(IOptions <PowerSecrets> powerOptions, PowerContext context,
                              IDatabaseService databaseService)
 {
     _powerOptions    = powerOptions;
     _context         = context;
     _databaseService = databaseService;
 }
Example #10
0
        public ZombieDog(Map.World world, PowerContext context, int dogID)
            : base(world, 51353, context.User, null)
        {
            Scale = 1.35f;
            //TODO: get a proper value for this.
            this.WalkSpeed *= 3;
            SetBrain(new MinionBrain(this));
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max_Total] = 20f;
            Attributes[GameAttribute.Hitpoints_Max] = 20f;
            Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            Attributes[GameAttribute.Hitpoints_Cur] = 20f;
            Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = dogID,
                PetId = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #11
0
        public AncientTalic(Map.World world, PowerContext context, int AncientsID)
            : base(world, 90535, context.User, null)
        {
            Scale = 1.2f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 3;
            SetBrain(new MinionBrain(this));
            (Brain as MonsterBrain).AddPresetPower(30592);  //Weapon_Instant
            (Brain as MonsterBrain).AddPresetPower(187092); //basic melee
            (Brain as MonsterBrain).AddPresetPower(168825); //Leap //Only Active with Rune_E
            (Brain as MonsterBrain).AddPresetPower(168830); //WhirlWind
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max_Total] = 20f;
            Attributes[GameAttribute.Hitpoints_Max] = 20f;
            Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            Attributes[GameAttribute.Hitpoints_Cur] = 20f;
            Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = AncientsID,
                PetId = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #12
0
        //female ->123885
        //male -> 169904

        public MysticAllyMinion(Map.World world, PowerContext context, int MysticAllyID)
            : base(world, 123885, context.User, null)
        {
            Scale = 1.35f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            (Brain as MinionBrain).AddPresetPower(169081); //melee_instant
            (Brain as MinionBrain).AddPresetPower(169155); //Rune_aKick
            (Brain as MinionBrain).AddPresetPower(169325); //Rune_bWaveAttack
            (Brain as MinionBrain).AddPresetPower(169715); //Rune_cGroundPunch
            (Brain as MinionBrain).AddPresetPower(169728); //Rune_dAoeAttack
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max_Total] = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Hitpoints_Max_Total];
            Attributes[GameAttribute.Hitpoints_Max] = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Hitpoints_Max_Total];
            Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            Attributes[GameAttribute.Hitpoints_Cur] = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Hitpoints_Max_Total];
            Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = context.ScriptFormula(1);
            //Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = MysticAllyID,
                PetId = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #13
0
        public HexMinion(Map.World world, PowerContext context, int HexID)
            : base(world, 107826, context.User, null)
        {
            Scale = 1f;
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            (Brain as MinionBrain).AddPresetPower(196974); //chicken_walk.pow
            (Brain as MinionBrain).AddPresetPower(188442); //explode.pow
            (Brain as MinionBrain).AddPresetPower(107301); //Fetish.pow
            (Brain as MinionBrain).AddPresetPower(107742); //Heal

            Attributes[GameAttribute.Hitpoints_Max_Total] = 5f;
            Attributes[GameAttribute.Hitpoints_Max] = 5f;
            Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
            Attributes[GameAttribute.Hitpoints_Cur] = 5f;
            Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.0f;


            Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = 5f;
            Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = 7f;

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = HexID,
                PetId = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #14
0
        public MirrorImageMinion(Map.World world, PowerContext context, int ImageID)
            : base(world, 98010, context.User, null) //male Mirror images
        {
            Scale = 1.2f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max] = 20f;
            Attributes[GameAttribute.Hitpoints_Cur] = 20f;
            Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = ImageID,
                PetId = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #15
0
        private static void Resolve(IPower power, string heroi)
        {
            PowerContext    context    = new PowerContext();
            PowerJobContext contextJob = new PowerJobContext();
            PowerJob        job        = new PowerJob(power, context);

            contextJob.SuperHero = heroi;

            var result = job.GetPower(contextJob);

            if (result.IsSuccess)
            {
                Console.WriteLine($"Herói: {result.Success.NameHero}");
                Console.WriteLine($"Poder: {result.Success.Name}");
                Console.WriteLine($"Dano: {result.Success.Damage}");
            }
            else
            {
                Console.WriteLine($"Herói: {heroi }");
                Console.WriteLine($"Error: {result.Error.Msg }");
            }

            Console.WriteLine();
            Console.WriteLine("// ------------------------ //");
            Console.WriteLine();
        }
Example #16
0
        //107031, 106731, 106749, 107067, 107107, 107112

        public CorpseSpider(Map.World world, PowerContext context, int SpiderID)
            : base(world, 107031, context.User, null)
        {
            Scale = 1.2f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            (Brain as MinionBrain).AddPresetPower(30592);  //melee_instant
            (Brain as MinionBrain).AddPresetPower(30005);  //AINearby
            (Brain as MinionBrain).AddPresetPower(107103); //Spider_leap
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max]      = 20f;
            Attributes[GameAttribute.Hitpoints_Cur]      = 20f;
            Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min, 0]   = context.ScriptFormula(16) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(17) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = SpiderID,
                PetId  = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #17
0
        public GargantuanMinion(Map.World world, PowerContext context, int GargID)
            : base(world, 122305, context.User, null)
        {
            Scale = 1f;
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));

            (Brain as MinionBrain).AddPresetPower(30005);
            (Brain as MinionBrain).AddPresetPower(30001);
            (Brain as MinionBrain).AddPresetPower(30592);
            (Brain as MinionBrain).AddPresetPower(30550);
            Attributes[GameAttribute.Hitpoints_Max] = 5f;
            Attributes[GameAttribute.Hitpoints_Cur] = 5f;
            Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;


            Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f;
            Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 7f;
            
            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = GargID,
                PetId = this.DynamicID,
                Field3 = 0x8,
            });
        }
    public PowContext pow()
    {
        PowContext _localctx = new PowContext(Context, State);

        EnterRule(_localctx, 8, RULE_pow);
        try {
            _localctx = new PowerContext(_localctx);
            EnterOuterAlt(_localctx, 1);
            {
                State = 58; unaryMinus();
                State = 61;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 6, Context))
                {
                case 1:
                {
                    State = 59; Match(POW);
                    State = 60; pow();
                }
                break;
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Example #19
0
        public AncientMawdawc(Map.World world, PowerContext context, int AncientsID)
            : base(world, 90536, context.User, null)
        {
            Scale = 1.2f; //they look cooler bigger :)
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            (Brain as MinionBrain).AddPresetPower(30592);  //Weapon_Instant
            (Brain as MinionBrain).AddPresetPower(187092); //basic melee
            (Brain as MinionBrain).AddPresetPower(168827); //Seismic Slam //Only Active with Rune_C
            (Brain as MinionBrain).AddPresetPower(168828); //Weapon Throw
            //TODO: These values should most likely scale, but we don't know how yet, so just temporary values.
            Attributes[GameAttribute.Hitpoints_Max]      = 20f;
            Attributes[GameAttribute.Hitpoints_Cur]      = 20f;
            Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min, 0]   = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = AncientsID,
                PetId  = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #20
0
        public HexMinion(Map.World world, PowerContext context, int HexID)
            : base(world, 107826, context.User, null)
        {
            Scale = 1f;
            //TODO: get a proper value for this.
            this.WalkSpeed *= 5;
            SetBrain(new MinionBrain(this));
            (Brain as MinionBrain).AddPresetPower(196974); //chicken_walk.pow
            (Brain as MinionBrain).AddPresetPower(188442); //explode.pow
            (Brain as MinionBrain).AddPresetPower(107301); //Fetish.pow
            (Brain as MinionBrain).AddPresetPower(107742); //Heal

            Attributes[GameAttribute.Hitpoints_Max]      = 5f;
            Attributes[GameAttribute.Hitpoints_Cur]      = 5f;
            Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;

            Attributes[GameAttribute.Damage_Weapon_Min, 0]   = 5f;
            Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 7f;

            Attributes[GameAttribute.Pet_Type] = 0x8;
            //Pet_Owner and Pet_Creator seems to be 0
            (context.User as Player).InGameClient.SendMessage(new PetMessage()
            {
                Field0 = 0,
                Field1 = HexID,
                PetId  = this.DynamicID,
                Field3 = 0x8,
            });
        }
Example #21
0
 public List <Consumer> Get()
 {
     using (PowerContext db = new PowerContext())
     {
         var Consumers = from p in db.Consumers
                         select p;
         return(Consumers.ToList());
     }
 }
Example #22
0
 public List <SupplyPoint> Get()
 {
     using (PowerContext db = new PowerContext())
     {
         var SupplyPoints = from p in db.SupplyPoints
                            select p;
         return(SupplyPoints.ToList());
     }
 }
Example #23
0
 public List <Affiliate> Get()
 {
     using (PowerContext db = new PowerContext())
     {
         var Affiliates = from p in db.Affiliates
                          select p;
         return(Affiliates.ToList());
     }
 }
Example #24
0
 public List <CalcUnit> Get()
 {
     using (PowerContext db = new PowerContext())
     {
         var CalcUnits = from p in db.CalcUnits
                         .Include("SupplyPoint")
                         select p;
         return(CalcUnits.ToList());
     }
 }
Example #25
0
 public List <ElectricMeter> Meters(int id)
 {
     using (PowerContext db = new PowerContext())
     {
         var ElectricMeters = from p in db.ElectricMeters
                              .Include("MeterType")
                              where (p.CheckDate <= DateTime.Now) && ((id == 0) || (p.MeasurePoint.ConsumerID == id))
                              select p;
         return(ElectricMeters.ToList());
     }
 }
Example #26
0
 public List <CurrentTransformer> CurrentTransformers(int id)
 {
     using (PowerContext db = new PowerContext())
     {
         var CurrentTransformers = from p in db.CurrentTransformers
                                   .Include("CTType")
                                   where (p.CheckDate <= DateTime.Now) && ((id == 0) || (p.MeasurePoint.ConsumerID == id))
                                   select p;
         return(CurrentTransformers.ToList());
     }
 }
Example #27
0
        public List <CalcUnit> Year(int id)
        {
            using (PowerContext db = new PowerContext())
            {
                var timeFrom = new DateTime(id, 1, 1);
                var timeTo   = new DateTime(id + 1, 1, 1);

                var CalcUnits = from p in db.CalcUnits
                                .Include("SupplyPoint")
                                where ((p.TimeFrom >= timeFrom) && (p.TimeFrom < timeTo)) || ((p.TimeTo >= timeFrom) && (p.TimeTo < timeTo))
                                select p;
                return(CalcUnits.ToList());
            }
        }
Example #28
0
        public IActionResult Post([FromBody] MeasurePoint MeasurePoint)
        {
            //MeasurePoint MeasurePoint = JsonConvert.DeserializeObject<MeasurePoint>(JsonString);
            using (PowerContext db = new PowerContext())
            {
                if (MeasurePoint.ElectricMeter.MeterType != null && MeasurePoint.VoltageTransformer.VTType != null && MeasurePoint.CurrentTransformer.CTType != null)
                {
                    var ExistingMeterName = db.MeterTypes.SingleOrDefault(p => p.Title == MeasurePoint.ElectricMeter.MeterType.Title);
                    if (ExistingMeterName != null)
                    {
                        MeasurePoint.ElectricMeter.MeterType = ExistingMeterName;
                    }
                    else
                    {
                        db.MeterTypes.Add(MeasurePoint.ElectricMeter.MeterType);
                    }

                    var ExistingVTName = db.VTTypes.SingleOrDefault(p => p.Title == MeasurePoint.VoltageTransformer.VTType.Title);
                    if (ExistingVTName != null)
                    {
                        MeasurePoint.VoltageTransformer.VTType = ExistingVTName;
                    }
                    else
                    {
                        db.VTTypes.Add(MeasurePoint.VoltageTransformer.VTType);
                    }

                    var ExistingCTName = db.CTTypes.SingleOrDefault(p => p.Title == MeasurePoint.CurrentTransformer.CTType.Title);
                    if (ExistingCTName != null)
                    {
                        MeasurePoint.CurrentTransformer.CTType = ExistingCTName;
                    }
                    else
                    {
                        db.CTTypes.Add(MeasurePoint.CurrentTransformer.CTType);
                    }

                    db.VoltageTransformers.Add(MeasurePoint.VoltageTransformer);
                    db.CurrentTransformers.Add(MeasurePoint.CurrentTransformer);
                    db.ElectricMeters.Add(MeasurePoint.ElectricMeter);

                    db.MeasurePoints.Add(MeasurePoint);
                    db.SaveChanges();
                }
                return(Ok(MeasurePoint));
            }
        }
Example #29
0
        public EffectActor(PowerContext context, int actorSNO, Vector3D position)
            : base(context.World, actorSNO)
        {
            this.Field2 = 0x8;
            if (this.Scale == 0f)
                this.Scale = 1f;
            this.Position = position;

            this.Timeout = null;

            // copy in important effect params from user
            this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO];
            this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO];
        }
Example #30
0
    public PowerContext power()
    {
        PowerContext _localctx = new PowerContext(Context, State);

        EnterRule(_localctx, 8, RULE_power);
        try {
            State = 49;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 3, Context))
            {
            case 1:
                _localctx = new FactorPowopNegateContext(_localctx);
                EnterOuterAlt(_localctx, 1);
                {
                    State = 44;
                    factor();
                    State = 45;
                    Match(POWOP);
                    State = 46;
                    negate();
                }
                break;

            case 2:
                _localctx = new PowerToFactorContext(_localctx);
                EnterOuterAlt(_localctx, 2);
                {
                    State = 48;
                    factor();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Example #31
0
        public HitPayload(AttackPayload attackPayload, bool criticalHit, Actor target)
        {
            this.Context = attackPayload.Context;
            this.Target = target;
            this.IsCriticalHit = criticalHit;
            
            // TODO: select these values based on element type?
            float weaponMinDamage = this.Context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            float weaponDamageDelta = this.Context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            // calculate and add up damage amount for each element type
            this.ElementDamages = new Dictionary<DamageType, float>();

            foreach (var entry in attackPayload.DamageEntries)
            {
                if (!this.ElementDamages.ContainsKey(entry.DamageType))
                    this.ElementDamages[entry.DamageType] = 0f;

                if (entry.IsWeaponBasedDamage)
                    this.ElementDamages[entry.DamageType] += entry.WeaponDamageMultiplier *
                        (weaponMinDamage + (float)PowerContext.Rand.NextDouble() * weaponDamageDelta);
                else
                    this.ElementDamages[entry.DamageType] += entry.MinDamage + (float)PowerContext.Rand.NextDouble() * entry.DamageDelta;
            }

            // apply critical damage boost
            if (criticalHit)
            {
                // TODO: probably will calculate this off of GameAttribute.Crit_Damage_Percent, but right now that attribute is never set
                var damTypes = this.ElementDamages.Keys.ToArray();
                foreach (var type in damTypes)
                    this.ElementDamages[type] *= 1.0f + 0.25f;
            }

            // TODO: reduce element damage amounts according to target's resistances

            // TODO: reduce total damage by target's armor

            this.TotalDamage = this.ElementDamages.Sum(kv => kv.Value);
            this.DominantDamageType = this.ElementDamages.OrderByDescending(kv => kv.Value).FirstOrDefault().Key;
        }
Example #32
0
        //public ActionResult<IEnumerable<MeasurePoint>> Get()
        public JsonResult Get()
        {
            using (PowerContext db = new PowerContext())
            {
                var MeasurePoints = from p in db.MeasurePoints
                                    .Include("Consumer")
                                    .Include("ElectricMeter")
                                    .Include("VoltageTransformer")
                                    .Include("CurrentTransformer")
                                    .Include("ElectricMeter.MeterType")
                                    .Include("VoltageTransformer.VTType")
                                    .Include("CurrentTransformer.CTType")
                                    select p;

                return(new JsonResult(MeasurePoints.ToList(),
                                      new JsonSerializerSettings()
                {
                    ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                }));
            }
        }
Example #33
0
        public static void EnsureSeedData(this PowerContext context)
        {
            if (!context.Database.GetPendingMigrations().Any())
            {
                if (!context.Usinas.Any())
                {
                    context.Usinas.AddRange(AddUsinas());
                }

                if (!context.Agentes.Any())
                {
                    context.Agentes.AddRange(AddAgentes());
                }
                context.SaveChanges();

                if (!context.Equipamentos.Any())
                {
                    context.Equipamentos.AddRange(AddEquipamentos());
                }
                context.SaveChanges();
            }
        }
 protected void SetProjectile(PowerContext context, int actorSNO, Common.Types.Math.Vector3D position, float speed = 1f, Action <Actor> OnCollision = null)
 {
     projectile             = new Projectile(context, actorSNO, position);
     projectile.OnCollision = OnCollision;
     this.speed             = speed;
 }
Example #35
0
 public DeathPayload(PowerContext context, DamageType deathDamageType, Actor target)
 {
     this.Context = context;
     this.DeathDamageType = deathDamageType;
     this.Target = target;
 }
Example #36
0
        public bool LootAndExp; //HACK: As we currently just give out random exp and loot, this is in to prevent giving this out for mobs that shouldn't give it.

        public DeathPayload(PowerContext context, DamageType deathDamageType, Actor target, bool grantsLootAndExp = true)
            : base(context, target)
        {
            this.LootAndExp = grantsLootAndExp;
            this.DeathDamageType = deathDamageType;
        }
    private ExprContext expr(int _p)
    {
        ParserRuleContext _parentctx = Context;
        int         _parentState     = State;
        ExprContext _localctx        = new ExprContext(Context, _parentState);
        ExprContext _prevctx         = _localctx;
        int         _startState      = 0;

        EnterRecursionRule(_localctx, 0, RULE_expr, _p);
        int _la;

        try {
            int _alt;
            EnterOuterAlt(_localctx, 1);
            {
                State = 9;
                ErrorHandler.Sync(this);
                switch (TokenStream.LA(1))
                {
                case OP:
                {
                    _localctx = new ParenExpContext(_localctx);
                    Context   = _localctx;
                    _prevctx  = _localctx;

                    State = 3; Match(OP);
                    State = 4; expr(0);
                    State = 5; Match(CP);
                }
                break;

                case VAR:
                {
                    _localctx = new VarContext(_localctx);
                    Context   = _localctx;
                    _prevctx  = _localctx;
                    State     = 7; Match(VAR);
                }
                break;

                case NUM:
                {
                    _localctx = new ConstContext(_localctx);
                    Context   = _localctx;
                    _prevctx  = _localctx;
                    State     = 8; Match(NUM);
                }
                break;

                default:
                    throw new NoViableAltException(this);
                }
                Context.Stop = TokenStream.LT(-1);
                State        = 24;
                ErrorHandler.Sync(this);
                _alt = Interpreter.AdaptivePredict(TokenStream, 3, Context);
                while (_alt != 2 && _alt != global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER)
                {
                    if (_alt == 1)
                    {
                        if (ParseListeners != null)
                        {
                            TriggerExitRuleEvent();
                        }
                        _prevctx = _localctx;
                        {
                            State = 22;
                            ErrorHandler.Sync(this);
                            switch (Interpreter.AdaptivePredict(TokenStream, 2, Context))
                            {
                            case 1:
                            {
                                _localctx = new PowerContext(new ExprContext(_parentctx, _parentState));
                                PushNewRecursionContext(_localctx, _startState, RULE_expr);
                                State = 11;
                                if (!(Precpred(Context, 5)))
                                {
                                    throw new FailedPredicateException(this, "Precpred(Context, 5)");
                                }
                                State = 12; Match(POWER);
                                State = 13; expr(5);
                            }
                            break;

                            case 2:
                            {
                                _localctx = new ProdContext(new ExprContext(_parentctx, _parentState));
                                PushNewRecursionContext(_localctx, _startState, RULE_expr);
                                State = 14;
                                if (!(Precpred(Context, 4)))
                                {
                                    throw new FailedPredicateException(this, "Precpred(Context, 4)");
                                }
                                State = 16;
                                ErrorHandler.Sync(this);
                                _la = TokenStream.LA(1);
                                if (_la == PROD)
                                {
                                    {
                                        State = 15; Match(PROD);
                                    }
                                }

                                State = 18; expr(5);
                            }
                            break;

                            case 3:
                            {
                                _localctx = new PlusminusContext(new ExprContext(_parentctx, _parentState));
                                PushNewRecursionContext(_localctx, _startState, RULE_expr);
                                State = 19;
                                if (!(Precpred(Context, 3)))
                                {
                                    throw new FailedPredicateException(this, "Precpred(Context, 3)");
                                }
                                State = 20;
                                _la   = TokenStream.LA(1);
                                if (!(_la == PLUS || _la == MINUS))
                                {
                                    ErrorHandler.RecoverInline(this);
                                }
                                else
                                {
                                    ErrorHandler.ReportMatch(this);
                                    Consume();
                                }
                                State = 21; expr(4);
                            }
                            break;
                            }
                        }
                    }
                    State = 26;
                    ErrorHandler.Sync(this);
                    _alt = Interpreter.AdaptivePredict(TokenStream, 3, Context);
                }
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            UnrollRecursionContexts(_parentctx);
        }
        return(_localctx);
    }
Example #38
0
 protected void SetProjectile(PowerContext context, int actorSNO, Common.Types.Math.Vector3D position, float speed = 1f, Action<Actor> OnCollision = null)
 {
     projectile = new Projectile(context, actorSNO, position);
     projectile.OnCollision = OnCollision;
     this.speed = speed;
 }
Example #39
0
 public AttackPayload(PowerContext context)
     : base(context, context.User)
 {
 }
Example #40
0
 public Payload(PowerContext context, Actor target)
 {
     this.Context = context;
     this.Target  = target;
 }
Example #41
0
	public PowerContext power() {
		PowerContext _localctx = new PowerContext(Context, State);
		EnterRule(_localctx, 126, RULE_power);
		int _la;
		try {
			EnterOuterAlt(_localctx, 1);
			{
			State = 817; atom();
			State = 821;
			ErrorHandler.Sync(this);
			_la = TokenStream.La(1);
			while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << DOT) | (1L << OPEN_PAREN) | (1L << OPEN_BRACK))) != 0)) {
				{
				{
				State = 818; trailer();
				}
				}
				State = 823;
				ErrorHandler.Sync(this);
				_la = TokenStream.La(1);
			}
			State = 826;
			_la = TokenStream.La(1);
			if (_la==POWER) {
				{
				State = 824; Match(POWER);
				State = 825; factor();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}
Example #42
0
 public DeathPayload(PowerContext context, DamageType deathDamageType, Actor target)
     : base(context, target)
 {
     this.DeathDamageType = deathDamageType;
 }
Example #43
0
        public void Kill(PowerContext context = null, bool lootAndExp = false)
        {
            var deathload = new DeathPayload(context, Powers.DamageType.Physical, this, lootAndExp);

            deathload.Apply();
        }
Example #44
0
 public void Kill(PowerContext context = null, bool lootAndExp = false)
 {
     var deathload = new DeathPayload(context, Powers.DamageType.Physical, this, lootAndExp);
     deathload.Apply();
 }
Example #45
0
 public PowerToFactorContext(PowerContext context)
 {
     CopyFrom(context);
 }
Example #46
0
 public Payload(PowerContext context, Actor target)
 {
     this.Context = context;
     this.Target = target;
 }
Example #47
0
        public bool LootAndExp; //HACK: As we currently just give out random exp and loot, this is in to prevent giving this out for mobs that shouldn't give it.

        public DeathPayload(PowerContext context, DamageType deathDamageType, Actor target, bool grantsLootAndExp = true)
            : base(context, target)
        {
            this.LootAndExp      = grantsLootAndExp;
            this.DeathDamageType = deathDamageType;
        }
Example #48
0
 public DeathPayload(PowerContext context, DamageType deathDamageType, Actor target)
     : base(context, target)
 {
     this.DeathDamageType = deathDamageType;
 }
Example #49
0
	private ExprContext expr(int _p) {
		ParserRuleContext _parentctx = Context;
		int _parentState = State;
		ExprContext _localctx = new ExprContext(Context, _parentState);
		ExprContext _prevctx = _localctx;
		int _startState = 4;
		EnterRecursionRule(_localctx, 4, RULE_expr, _p);
		int _la;
		try {
			int _alt;
			EnterOuterAlt(_localctx, 1);
			{
			State = 129;
			switch ( Interpreter.AdaptivePredict(TokenStream,12,Context) ) {
			case 1:
				{
				_localctx = new SignContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;

				State = 35;
				_la = TokenStream.La(1);
				if ( !(_la==T__14 || _la==T__15) ) {
				ErrorHandler.RecoverInline(this);
				}
				else {
				    Consume();
				}
				State = 36; expr(35);
				}
				break;
			case 2:
				{
				_localctx = new NegationContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 37; Match(T__25);
				State = 38; expr(29);
				}
				break;
			case 3:
				{
				_localctx = new FormulaeContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 39; Match(T__30);
				State = 40; expr(26);
				}
				break;
			case 4:
				{
				_localctx = new FunctionContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 41; Match(T__34);
				State = 42; Match(T__7);
				State = 44;
				_la = TokenStream.La(1);
				if (_la==T__53 || _la==ID) {
					{
					State = 43; formlist();
					}
				}

				State = 46; Match(T__8);
				State = 47; expr(23);
				}
				break;
			case 5:
				{
				_localctx = new RepeatStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 48; Match(T__42);
				State = 52;
				ErrorHandler.Sync(this);
				_la = TokenStream.La(1);
				while (_la==NL) {
					{
					{
					State = 49; Match(NL);
					}
					}
					State = 54;
					ErrorHandler.Sync(this);
					_la = TokenStream.La(1);
				}
				State = 55; expr(17);
				}
				break;
			case 6:
				{
				_localctx = new HelpContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 56; Match(T__43);
				State = 57; expr(16);
				}
				break;
			case 7:
				{
				_localctx = new CompoundContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 58; Match(T__35);
				State = 60;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 59; Match(NL);
					}
				}

				State = 62; exprlist();
				State = 63; Match(T__36);
				}
				break;
			case 8:
				{
				_localctx = new IfStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 65; Match(T__37);
				State = 66; Match(T__7);
				State = 67; expr(0);
				State = 68; Match(T__8);
				State = 70;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 69; Match(NL);
					}
				}

				State = 72; expr(0);
				}
				break;
			case 9:
				{
				_localctx = new IfElseStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 74; Match(T__37);
				State = 75; Match(T__7);
				State = 76; expr(0);
				State = 77; Match(T__8);
				State = 79;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 78; Match(NL);
					}
				}

				State = 81; expr(0);
				State = 83;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 82; Match(NL);
					}
				}

				State = 85; Match(T__38);
				State = 87;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 86; Match(NL);
					}
				}

				State = 89; expr(0);
				}
				break;
			case 10:
				{
				_localctx = new ForEachStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 91; Match(T__39);
				State = 92; Match(T__7);
				State = 93; Match(ID);
				State = 94; Match(T__40);
				State = 95; expr(0);
				State = 96; Match(T__8);
				State = 98;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 97; Match(NL);
					}
				}

				State = 100; expr(0);
				}
				break;
			case 11:
				{
				_localctx = new WhileStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 102; Match(T__41);
				State = 103; Match(T__7);
				State = 104; expr(0);
				State = 105; Match(T__8);
				State = 107;
				_la = TokenStream.La(1);
				if (_la==NL) {
					{
					State = 106; Match(NL);
					}
				}

				State = 109; expr(0);
				}
				break;
			case 12:
				{
				_localctx = new NextStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 111; Match(T__44);
				}
				break;
			case 13:
				{
				_localctx = new BreakStatementContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 112; Match(T__45);
				}
				break;
			case 14:
				{
				_localctx = new ParenthesizedContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 113; Match(T__7);
				State = 114; expr(0);
				State = 115; Match(T__8);
				}
				break;
			case 15:
				{
				_localctx = new IdentifierContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 117; Match(ID);
				}
				break;
			case 16:
				{
				_localctx = new StringLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 118; Match(STRING);
				}
				break;
			case 17:
				{
				_localctx = new HexLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 119; Match(HEX);
				}
				break;
			case 18:
				{
				_localctx = new IntLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 120; Match(INT);
				}
				break;
			case 19:
				{
				_localctx = new FloatLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 121; Match(FLOAT);
				}
				break;
			case 20:
				{
				_localctx = new ComplexLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 122; Match(COMPLEX);
				}
				break;
			case 21:
				{
				_localctx = new NullLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 123; Match(T__46);
				}
				break;
			case 22:
				{
				_localctx = new NAContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 124; Match(T__47);
				}
				break;
			case 23:
				{
				_localctx = new InfLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 125; Match(T__48);
				}
				break;
			case 24:
				{
				_localctx = new NanLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 126; Match(T__49);
				}
				break;
			case 25:
				{
				_localctx = new TrueLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 127; Match(T__50);
				}
				break;
			case 26:
				{
				_localctx = new FalseLiteralContext(_localctx);
				Context = _localctx;
				_prevctx = _localctx;
				State = 128; Match(T__51);
				}
				break;
			}
			Context.Stop = TokenStream.Lt(-1);
			State = 185;
			ErrorHandler.Sync(this);
			_alt = Interpreter.AdaptivePredict(TokenStream,14,Context);
			while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber ) {
				if ( _alt==1 ) {
					if ( ParseListeners!=null )
						TriggerExitRuleEvent();
					_prevctx = _localctx;
					{
					State = 183;
					switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) {
					case 1:
						{
						_localctx = new NamespaceContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 131;
						if (!(Precpred(Context, 38))) throw new FailedPredicateException(this, "Precpred(Context, 38)");
						State = 132;
						_la = TokenStream.La(1);
						if ( !(_la==T__9 || _la==T__10) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 133; expr(39);
						}
						break;
					case 2:
						{
						_localctx = new MemberAccessContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 134;
						if (!(Precpred(Context, 37))) throw new FailedPredicateException(this, "Precpred(Context, 37)");
						State = 135;
						_la = TokenStream.La(1);
						if ( !(_la==T__11 || _la==T__12) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 136; expr(38);
						}
						break;
					case 3:
						{
						_localctx = new PowerContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 137;
						if (!(Precpred(Context, 36))) throw new FailedPredicateException(this, "Precpred(Context, 36)");
						State = 138; Match(T__13);
						State = 139; expr(37);
						}
						break;
					case 4:
						{
						_localctx = new SequenceContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 140;
						if (!(Precpred(Context, 34))) throw new FailedPredicateException(this, "Precpred(Context, 34)");
						State = 141; Match(T__16);
						State = 142; expr(35);
						}
						break;
					case 5:
						{
						_localctx = new UserOpContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 143;
						if (!(Precpred(Context, 33))) throw new FailedPredicateException(this, "Precpred(Context, 33)");
						State = 144; Match(USER_OP);
						State = 145; expr(34);
						}
						break;
					case 6:
						{
						_localctx = new MultiplicationContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 146;
						if (!(Precpred(Context, 32))) throw new FailedPredicateException(this, "Precpred(Context, 32)");
						State = 147;
						_la = TokenStream.La(1);
						if ( !(_la==T__17 || _la==T__18) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 148; expr(33);
						}
						break;
					case 7:
						{
						_localctx = new AdditionContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 149;
						if (!(Precpred(Context, 31))) throw new FailedPredicateException(this, "Precpred(Context, 31)");
						State = 150;
						_la = TokenStream.La(1);
						if ( !(_la==T__14 || _la==T__15) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 151; expr(32);
						}
						break;
					case 8:
						{
						_localctx = new ComparisonContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 152;
						if (!(Precpred(Context, 30))) throw new FailedPredicateException(this, "Precpred(Context, 30)");
						State = 153;
						_la = TokenStream.La(1);
						if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__19) | (1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24))) != 0)) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 154; expr(31);
						}
						break;
					case 9:
						{
						_localctx = new LogicalAndContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 155;
						if (!(Precpred(Context, 28))) throw new FailedPredicateException(this, "Precpred(Context, 28)");
						State = 156;
						_la = TokenStream.La(1);
						if ( !(_la==T__26 || _la==T__27) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 157; expr(29);
						}
						break;
					case 10:
						{
						_localctx = new LogicalOrContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 158;
						if (!(Precpred(Context, 27))) throw new FailedPredicateException(this, "Precpred(Context, 27)");
						State = 159;
						_la = TokenStream.La(1);
						if ( !(_la==T__28 || _la==T__29) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 160; expr(28);
						}
						break;
					case 11:
						{
						_localctx = new FormulaeContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 161;
						if (!(Precpred(Context, 25))) throw new FailedPredicateException(this, "Precpred(Context, 25)");
						State = 162; Match(T__30);
						State = 163; expr(26);
						}
						break;
					case 12:
						{
						_localctx = new RightAssignmentContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 164;
						if (!(Precpred(Context, 24))) throw new FailedPredicateException(this, "Precpred(Context, 24)");
						State = 165;
						_la = TokenStream.La(1);
						if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__31) | (1L << T__32) | (1L << T__33))) != 0)) ) {
						ErrorHandler.RecoverInline(this);
						}
						else {
						    Consume();
						}
						State = 166; expr(25);
						}
						break;
					case 13:
						{
						_localctx = new ListAccessContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 167;
						if (!(Precpred(Context, 41))) throw new FailedPredicateException(this, "Precpred(Context, 41)");
						State = 168; Match(T__4);
						State = 169; sublist();
						State = 170; Match(T__5);
						State = 171; Match(T__5);
						}
						break;
					case 14:
						{
						_localctx = new IndexContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 173;
						if (!(Precpred(Context, 40))) throw new FailedPredicateException(this, "Precpred(Context, 40)");
						State = 174; Match(T__6);
						State = 175; sublist();
						State = 176; Match(T__5);
						}
						break;
					case 15:
						{
						_localctx = new FunctionCallContext(new ExprContext(_parentctx, _parentState));
						PushNewRecursionContext(_localctx, _startState, RULE_expr);
						State = 178;
						if (!(Precpred(Context, 39))) throw new FailedPredicateException(this, "Precpred(Context, 39)");
						State = 179; Match(T__7);
						State = 180; sublist();
						State = 181; Match(T__8);
						}
						break;
					}
					} 
				}
				State = 187;
				ErrorHandler.Sync(this);
				_alt = Interpreter.AdaptivePredict(TokenStream,14,Context);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			UnrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}
Example #50
0
 public FactorPowopNegateContext(PowerContext context)
 {
     CopyFrom(context);
 }