コード例 #1
0
 public override bool changeWeapon(IWeapons changeWeapon)
 {
     if (changeWeapon.getName() == "Garra Letal")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else if (changeWeapon.getName() == "Porrete")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else if (changeWeapon.getName() == "Cajado")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
ファイル: RailGunViewTests.cs プロジェクト: zakvdm/Frenetic
 public void Setup()
 {
     stubWeapons = MockRepository.GenerateStub<IWeapons>();
     stubWeapons.Stub(me => me[WeaponType.RailGun]).Return(new RailGun(null));
     mockEffect = MockRepository.GenerateStub<ILineEffect>();
     view = new RailGunView(mockEffect);
 }
コード例 #3
0
 public override bool changeWeapon(IWeapons changeWeapon)
 {
     if (changeWeapon.getName() == "Cajado")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else if (changeWeapon.getName() == "Porrete")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else if (changeWeapon.getName() == "Besta")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else if (changeWeapon.getName() == "Esfera de Ataque")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #4
0
ファイル: BasePlayer.cs プロジェクト: zakvdm/Frenetic
        public BasePlayer(IPlayerSettings playerSettings, IPhysicsComponent physicsComponent, IBoundaryCollider boundaryCollider, IWeapons weapons, ITimer timer)
        {
            this.PlayerSettings = playerSettings;
            this.PlayerScore = new PlayerScore();

            if (physicsComponent == null)
                this.PhysicsComponent = new DummyPhysicsComponent();
            else
                this.PhysicsComponent = physicsComponent;

            this.PhysicsComponent.CollidedWithWorld += () => InContactWithLevel = true;
            this.PhysicsComponent.WasShot += Damage;

            this.Weapons = weapons;
            this.Weapons.DamagedAPlayer += (damage, physicsComp) => physicsComp.OnWasShot(this, damage);

            this.Timer = timer;
            this.BoundaryCollider = boundaryCollider;

            this.Health = BasePlayer.StartHealth;
            this.Status = PlayerStatus.Alive;
            this.Position = new Vector2(400, 100);

            this.PhysicsComponent.CollisionGroup = BasePlayer.CollisionGroup;
        }
コード例 #5
0
 public void Setup()
 {
     stubWeapons = MockRepository.GenerateStub<IWeapons>();
     stubWeapons.Stub(me => me[WeaponType.RocketLauncher]).Return(new RocketLauncher(null));
     ((RocketLauncher)stubWeapons[WeaponType.RocketLauncher]).Rockets.Add(new Rocket(Vector2.Zero, Vector2.Zero, new Frenetic.Physics.DummyPhysicsComponent()));
     mockEffects = MockRepository.GenerateStub<IEffect>();
     view = new RocketLauncherView(mockEffects);
 }
コード例 #6
0
ファイル: PlayerTests.cs プロジェクト: zakvdm/Frenetic
 public void SetUp()
 {
     stubPlayerSettings = MockRepository.GenerateStub<IPlayerSettings>();
     stubPhysicsComponent = MockRepository.GenerateStub<IPhysicsComponent>();
     stubBoundaryCollider = MockRepository.GenerateStub<IBoundaryCollider>();
     stubWeapons = MockRepository.GenerateStub<IWeapons>();
     stubTimer = MockRepository.GenerateStub<ITimer>();
     player = new BasePlayer(stubPlayerSettings, stubPhysicsComponent, stubBoundaryCollider, stubWeapons, stubTimer);
 }
コード例 #7
0
ファイル: RailGunView.cs プロジェクト: zakvdm/Frenetic
        public void DrawWeapon(IWeapons weapons)
        {
            var railGun = weapons[WeaponType.RailGun] as RailGun;

            foreach (var slug in railGun.Slugs)
            {
                SetAndTriggerEffectParameters(slug);
            }
        }
コード例 #8
0
 public ArmyFactory(ISquads squads,
                    IWeapons weapons,
                    IArmors armors,
                    IUsers users,
                    IArmyCostLimitService costLimit)
 {
     this.squads    = squads;
     this.weapons   = weapons;
     this.armors    = armors;
     this.users     = users;
     this.costLimit = costLimit;
 }
コード例 #9
0
 public Animal()
 {
     _life        = 3200;
     _mana        = 30;
     _atackdamage = 80;
     _spelldamage = 20;
     _armorresist = 90;
     _magicresist = 20;
     _agility     = 50;
     _allSpell    = new Attack_Spell[1];
     _allSpell[0] = new Bio();
     weapons      = new IWeapons[1];
 }
コード例 #10
0
 public Zumbi()
 {
     _life        = 2500;
     _mana        = 20;
     _atackdamage = 40;
     _spelldamage = 20;
     _armorresist = 80;
     _magicresist = 90;
     _agility     = 20;
     _allSpell    = new Attack_Spell[1];
     _allSpell[0] = new Intoxication();
     weapons      = new IWeapons[3];
     _handsweapon = weapons[0];
 }
コード例 #11
0
 public Warrior()
 {
     _life        = 4000;
     _mana        = 30;
     _atackdamage = 100;
     _spelldamage = 20;
     _armorresist = 80;
     _magicresist = 20;
     _agility     = 50;
     _allSpell    = new Attack_Spell[1];
     _allSpell[0] = new Storm();
     weapons      = new IWeapons[2];
     _handsweapon = weapons[0];
 }
コード例 #12
0
 public Troll()
 {
     _life        = 2800;
     _mana        = 20;
     _atackdamage = 100;
     _spelldamage = 20;
     _armorresist = 100;
     _magicresist = 20;
     _agility     = 20;
     _allSpell    = new Attack_Spell[1];
     _allSpell[0] = new Intoxication();
     weapons      = new IWeapons[2];
     _handsweapon = weapons[0];
 }
コード例 #13
0
 public Dragon()
 {
     _life        = 3000;
     _mana        = 40;
     _atackdamage = 100;
     _spelldamage = 20;
     _armorresist = 100;
     _magicresist = 50;
     _agility     = 80;
     _allSpell    = new Attack_Spell[1];
     _allSpell[0] = new Fire_Breath();
     weapons      = new IWeapons[2];
     _handsweapon = weapons[0];
 }
コード例 #14
0
 public Thief()
 {
     _life        = 2800;
     _mana        = 50;
     _atackdamage = 50;
     _spelldamage = 30;
     _armorresist = 40;
     _magicresist = 50;
     _agility     = 100;
     _allSpell    = new Attack_Spell[2];
     _allSpell[0] = new Intoxication();
     _allSpell[1] = new Storm();
     weapons      = new IWeapons[4];
     _handsweapon = weapons[0];
 }
コード例 #15
0
ファイル: Weapon.cs プロジェクト: gendalf90/LetTheLordsFight
        public static async Task <Weapon> LoadAsync(IWeapons repository, string name)
        {
            var data = await repository.GetByNameAsync(name);

            var weapon = new Weapon(data.Name);

            weapon.cost    = new Cost(data.Cost);
            weapon.offence = data.Offence
                             .Select(LoadOffence)
                             .ToList();
            weapon.tags = data.Tags
                          .Select(tag => new Tag(tag))
                          .ToList();

            return(weapon);
        }
コード例 #16
0
 public Mage()
 {
     _life         = 2500;
     _mana         = 100;
     _atackdamage  = 40;
     _spelldamage  = 100;
     _armorresist  = 30;
     _magicresist  = 100;
     _agility      = 40;
     _healSpell    = new Healing_Spell[2];
     _healSpell[0] = new Potion_of_Life();
     _healSpell[1] = new Heal();
     _allSpell     = new Attack_Spell[4];
     weapons       = new IWeapons[2];
     _handsweapon  = weapons[0];
 }
コード例 #17
0
ファイル: RocketLauncherView.cs プロジェクト: zakvdm/Frenetic
        public void DrawWeapon(IWeapons weapons)
        {
            var rocketLauncher = weapons[WeaponType.RocketLauncher] as RocketLauncher;

            foreach (var rocket in rocketLauncher.Rockets)
            {
                this.ParticleEffects.Position = rocket.Position;
                if (rocket.IsAlive)
                {
                    this.ParticleEffects.Trigger(EffectType.RocketTrail);
                }
                else
                {
                    this.ParticleEffects.Trigger(EffectType.RocketExplosion);
                }
            }
        }
コード例 #18
0
 public Paladin()
 {
     _life        = 3200;
     _mana        = 80;
     _atackdamage = 60;
     _spelldamage = 60;
     _armorresist = 60;
     _magicresist = 60;
     _agility     = 60;
     weapons      = new IWeapons[2];
     _healSpell   = new Healing_Spell[1];
     _healSpell   = new Potion_of_Life[0];
     _handsweapon = weapons[0];
     _allSpell    = new Attack_Spell[3];
     _allSpell[0] = new Bio();
     _allSpell[1] = new Cold_Flame();
     _allSpell[2] = new Storm();
 }
コード例 #19
0
 /// <summary>
 /// Troca a arma para a mão no vetor de armas, utilizando uma interface.
 /// </summary>
 /// <param name="changeWeapon">Interface IWeapon's </param>
 /// <param name="_handsweapon">Arma que está sendo usada </param>
 /// <returns></returns>
 public override bool changeWeapon(IWeapons changeWeapon)
 {
     if (changeWeapon.getName() == "Cajado")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else if (changeWeapon.getName() == "Tridente Sagrado")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #20
0
 public override bool changeWeapon(IWeapons changeWeapon)
 {
     if (changeWeapon.getName() == "Espada Barroca")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else if (changeWeapon.getName() == "Porrete")
     {
         _handsweapon = changeWeapon;
         weapons[0]   = changeWeapon;
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #21
0
 public abstract bool changeWeapon(IWeapons changeWeapon);
コード例 #22
0
 private void NewWeaponPickedUp()
 {
     _currentWeapon = InventoryManager._currentWeaponClone.GetComponent <IWeapons>();
 }
コード例 #23
0
        public WeaponsController(IWeapons weaponService)

        {
            _weaponService = weaponService;
        }
コード例 #24
0
ファイル: NetworkPlayer.cs プロジェクト: zakvdm/Frenetic
 public const float SMOOTHING_FACTOR = 0.8f;     // 1f tries to catch up completely between each tick and is likely to be unstable
 public NetworkPlayer(IPlayerSettings playerSettings, IPhysicsComponent physicsComponent, IWeapons weapons, ITimer timer)
     : base(playerSettings, physicsComponent, null, weapons, timer)
 {
     LastReceivedPosition = this.Position;
 }
コード例 #25
0
 private void Start()
 {
     _weaponsLists  = InventoryManager.instance.weaponsList;
     _currentWeapon = _weaponsLists[0].GetComponent <IWeapons>();
 }
コード例 #26
0
ファイル: LocalPlayer.cs プロジェクト: zakvdm/Frenetic
 public LocalPlayer(IPlayerSettings playerSettings, IPhysicsComponent physicsComponent, IBoundaryCollider boundaryCollider, IWeapons weapons, ITimer timer)
     : base(playerSettings, physicsComponent, boundaryCollider, weapons, timer)
 {
     Console.Write("Creating Local Player");
 }
コード例 #27
0
ファイル: WeaponDrawer.cs プロジェクト: zakvdm/Frenetic
 private void UpdatePlayerWeaponsAfterDraw(IWeapons weapons)
 {
     // Once we've drawn explosions, we clear the dead projectiles.
     weapons.RemoveDeadProjectiles();
 }
コード例 #28
0
 private void OutAmmoAutoRemove()
 {
     _currentWeapon = InventoryManager._currentWeaponClone.GetComponent <IWeapons>();
 }