Esempio n. 1
0
 public Weapon(int maxBullets, string name, WeaponsType type)
 {
     _name               = name;
     WeaponsType         = type;
     MaxBullets          = maxBullets;
     CurrentBulletsCount = MaxBullets;
 }
Esempio n. 2
0
 private void AddBullets(int bullets, WeaponsType type)
 {
     foreach (var item in _allMyWeapons)
     {
         if (item.WeaponsType == type)
         {
             item.CurrentBulletsCount += bullets;
             Debug.Log("Add " + bullets + " bulets to" + type);
         }
     }
 }
Esempio n. 3
0
        // Create a weapon for the player
        private async Task CreateWeapon(Player player)
        {
            WeaponsType simpleWeapon = new WeaponsType();

            simpleWeapon.Name     = "Punch";
            simpleWeapon.Damage   = 30;
            simpleWeapon.MissRate = 10;
            var insertedWeaponTypeId = await weaponsTypeAccessLayer.AddAsync(simpleWeapon);

            Weapon weapon = new Weapon();

            weapon.WeaponTypeId = insertedWeaponTypeId;
            weapon.PlayerId     = player.Id;
            await weaponsAccessLayer.AddAsync(weapon);
        }
 public CastleDB(TextAsset castleDBAsset)
 {
     parsedDB  = new CastleDBParser(castleDBAsset);
     Scenarios = new ScenariosType(); GameModes = new GameModesType(); Global_Units = new Global_UnitsType(); Units_sub_categories = new Units_sub_categoriesType(); Units_categories = new Units_categoriesType(); Teams = new TeamsType(); Countries = new CountriesType(); HardPoints = new HardPointsType(); Weapons = new WeaponsType(); Weapons_roles = new Weapons_rolesType(); Ammos = new AmmosType(); FX_Storage = new FX_StorageType(); AudioFX_Storage = new AudioFX_StorageType();
 }
Esempio n. 5
0
        [Hook("Game.Data.Abilities.CEFKCKGJKKM")] // RegisterJob
        private void CEFKCKGJKKM(Abilities myAbility, ref string ClassName, ref string Name, ref string Description, ref string AbilityName, ref WeaponsType WeaponsAllowed, ref ArmorType ArmorAllowed, ref int BonusEvasion, ref int BonusCrit, ref int BaseMove, ref float BaseJump, ref bool CanSwim, ref float AttackGrowth, ref float MAttackGrowth, ref float DefenseGrowth, ref float MDefenseGrowth, ref float SpeedGrowth, ref float HealthMinGrowth, ref float HealthMaxGrowth, ref int AttackBase, ref int MAttackBase, ref int DefenseBase, ref int MDefenseBase, ref int SpeedBase, ref int HealthMinBase, ref int HealthMaxBase)
        {
            StreamWriter w = File.AppendText("fellmod_log.txt");

            Log("I'm here!", w);
            Log(ClassName, w);
            Abilities.Job        currentJob  = (Abilities.Job) typeof(Abilities).GetField("currentJob", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(myAbility);
            int                  nextAbility = (int)typeof(Abilities).GetField("nextAbility", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(myAbility);
            int                  nextJob     = (int)typeof(Abilities).GetField("nextJob", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(myAbility);
            List <Abilities.Job> jobs        = (List <Abilities.Job>) typeof(Abilities).GetField("jobs", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(myAbility);
            Dictionary <string, Abilities.Job> jobsByClassName = (Dictionary <string, Abilities.Job>) typeof(Abilities).GetField("jobsByClassName", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(myAbility);

            currentJob                    = new Abilities.Job();
            currentJob.className          = ClassName;
            currentJob.name               = Name;
            currentJob.abilityName        = AbilityName;
            currentJob.description        = "WHATEVER DESCRIPTION I WANT";
            currentJob.abilityDescription = string.Empty;
            currentJob.weaponsAllowed     = WeaponsAllowed;
            currentJob.armorsAllowed      = ArmorAllowed;
            currentJob.bonusEvasion       = BonusEvasion;
            currentJob.bonusCrit          = BonusCrit;
            currentJob.baseMovement       = BaseMove;
            currentJob.baseJump           = BaseJump;
            currentJob.canSwim            = CanSwim;
            currentJob.monsterJob         = false;
            currentJob.playerAvailable    = true;
            currentJob.statsGrowth[0]     = AttackGrowth * 0.5f;
            currentJob.statsGrowth[2]     = MAttackGrowth * 0.5f;
            currentJob.statsGrowth[1]     = DefenseGrowth * 0.5f;
            currentJob.statsGrowth[3]     = MDefenseGrowth * 0.5f;
            currentJob.speedGrowth        = SpeedGrowth * 250f / 150f;
            currentJob.healthGrowth[0]    = HealthMinGrowth;
            currentJob.healthGrowth[1]    = HealthMaxGrowth;
            currentJob.statsBase[0]       = (float)AttackBase * 0.5f;
            currentJob.statsBase[2]       = (float)MAttackBase * 0.5f;
            currentJob.statsBase[1]       = (float)DefenseBase * 0.5f;
            currentJob.statsBase[3]       = (float)MDefenseBase * 0.5f;
            currentJob.speedBase          = (float)SpeedBase * 1.66666663f;
            currentJob.healthBase[0]      = (float)HealthMinBase;
            currentJob.healthBase[1]      = (float)HealthMaxBase;
            nextAbility                   = 0;
            nextJob++;
            jobs.Add(currentJob);
            jobsByClassName.Add(ClassName, currentJob);
        }
Esempio n. 6
0
 public void HandWeapons(WeaponsType type)
 {
     m_Animator.SetInteger("WeaponType_int", (int)type);
     m_FireAngle = new Vector2(-0.8f, 0.6f);
 }
Esempio n. 7
0
    public IWeapon CreateItem(int bulletCount, WeaponsType weaponsType)
    {
        Weapon weapon = new Weapon(bulletCount, weaponsType.ToString() + "_" + Guid.NewGuid().ToString(), weaponsType);

        return(weapon);
    }