예제 #1
0
 public override void Update(float elapsed)
 {
     if (Game.currentState == States.State.StateType.ServerState)
     {
         Player    player = (Player)Game.states[Game.currentState].netState.Entities[id];
         RifleShot shot   = new RifleShot(player.rect.Position, player.direction, id);
         shot.Init();
     }
 }
예제 #2
0
    public void SetBasic(int abilityId)
    {
        IBasic basicToSet = new RifleShot();

        foreach (IAbility a in unlockedAbilities)
        {
            if (a.id == abilityId)
            {
                basicToSet = (IBasic)a;
            }
        }

        Basic = basicToSet;
    }
예제 #3
0
        public override Entity ToEntity()
        {
            RifleShot rifleShot = new RifleShot(new SFML.System.Vector2f(RectX, RectY), new SFML.System.Vector2f(DirectionX, DirectionY), ParentId);

            rifleShot.flags       = Flags;
            rifleShot.Id          = Id;
            rifleShot.moveDelta.X = MoveDeltaX;
            rifleShot.moveDelta.Y = MoveDeltaY;
            rifleShot.moveSpeed   = MoveSpeed;
            rifleShot.rect.Size   = new SFML.System.Vector2f(1, 1);
            rifleShot.type        = Type;

            return(rifleShot);
        }
예제 #4
0
    public void Awake()
    {
        potentialAbilities = new List <IAbility>()
        {
            new GrenadeThrow(), new MedKit(), new Zap(), new BioGrenade(), new RIPRounds(),
            new ShieldBooster(), new Revive(), new SentryTurret(), new Flamethrower(), new Stimpak(), new Invigorate(),
            new ChainLightning(), new Shockwave(), new LeechDart(), new FlameWall(), new SniperShot(), new SMGShot(), new RifleShot(), new ShotgunShot()
        };
        AbilityBindings = new Dictionary <KeyCode, int>();

        Basic = new RifleShot();

        unlockedAbilities = new List <IAbility>();
        //LoadUnlockedAbilities();
        // LoadHotBar();

        abilityArray = new ISpecial[4];// { one, two, three, four };
        for (int i = 0; i < abilityArray.Length; i++)
        {
            abilityArray[i] = new EmptyAbility();
        }
        SetDefaultBindings();
    }