Esempio n. 1
0
    public Berserker()
    {
        Abilities = new List <Ability>
        {
            new Lunge(),
            new Whirlwind(),
            new FocusEnergy(),
        };
        UnlearnedAbilities = new List <Ability> {
            new FocusPower(),
            new Stoneskin(),
            new Unwind(),
            new Hyper()
        };

        Resource = new Rage();

        // InitialHealth = ;
        // InitialAttack = ;
        // InitialDefense = ;
        // InitialSpeed = ;

        // HealthIncrement = ;
        // AttackIncrement = ;
        // DefenseIncrement = ;
        // SpeedIncrement = ;
    }
Esempio n. 2
0
    public void UpdateAbilityData(int slot)
    {
        int id = abilities[slot].GetID();

        switch (id)
        {
        case 1:
            Frenzy frenzy = (Frenzy)abilities[slot];
            frenzy.CalculateMult();
            break;

        case 2:
            Rage rage = (Rage)abilities[slot];
            rage.CalculateMult();
            break;

        case 3:
            Mine mine = (Mine)abilities[slot];
            mine.CalculateDamage();
            break;

        case 4:
            Fireball fireball = (Fireball)abilities[slot];
            fireball.CalculateDamage();
            break;
        }
    }
Esempio n. 3
0
 public Suspect(string pName, Rage.Model model, Rage.Vector3 position, float heading, bool confirmedSuspect = true) : base(pName, Common.PedType.Suspect, model, position, heading)
 {
     if (confirmedSuspect == false)
     {
         this.Type = Common.PedType.Unknown;
     }
 }
Esempio n. 4
0
 public Suspect(string pName, Rage.Vector3 position, bool confirmedSuspect = true) : base(pName, Common.PedType.Suspect, position)
 {
     if (confirmedSuspect == false)
     {
         this.Type = Common.PedType.Unknown;
     }
 }
Esempio n. 5
0
    public void KillCharacterOnTrigger(Collider2D collision)
    {
        if (!actionActivated)
        {
            return;
        }

        if (!collision.gameObject.CompareTag("Character"))
        {
            return;
        }

        Rage rage = collision.gameObject.GetComponent <Rage>();

        if (rage)
        {
            if (rage.abilityActive)
            {
                if (!actionActivated)
                {
                    return;
                }
            }
        }

        gameManager.sceneManager.RetryLevelOnKill();
    }
Esempio n. 6
0
 protected internal Suspect(string pName, Rage.PoolHandle handle, bool confirmedSuspect = true) : base(pName, Common.PedType.Suspect, handle)
 {
     if (confirmedSuspect == false)
     {
         this.Type = Common.PedType.Unknown;
     }
 }
Esempio n. 7
0
        public static string PointerToString(IntPtr pointer, bool freePointer = true)
        {
            if (pointer == IntPtr.Zero)
            {
                return(null);
            }

            var length = 0;

            while (Marshal.ReadByte(pointer, length) != 0)
            {
                ++length;
            }

            var buffer = new byte[length];

            Marshal.Copy(pointer, buffer, 0, buffer.Length);

            if (freePointer)
            {
                Rage.FreeArray(pointer);
            }

            return(Encoding.UTF8.GetString(buffer));
        }
Esempio n. 8
0
        private void Start()
        {
            health = GetComponent <Health>();
            rage   = GetComponent <Rage>();

            animator   = GetComponent <Animator>();
            controller = GetComponent <CharacterController>();

            playerCamera = GameObject.FindObjectOfType <PlayerCamera>();

            health.onEmpty     += OnDead;
            health.onDecrement += OnHurt;

            health.MinValue     = 0;
            health.MaxValue     = 100;
            health.CurrentValue = health.MaxValue;

            rage.onFull      += OnEnrage;
            rage.onEmpty     += OnCalm;
            rage.MinValue     = 0;
            rage.MaxValue     = 100;
            rage.CurrentValue = rage.MaxValue;

            // Game Manager has already been instantiated at this point
            GameManager.Instance.playerController = this;
            UIManager.Instance.ActivateUI("hud", true);

            health.onEmpty += GameManager.Instance.OnPlayerDead;
        }
    string GetAbilityDescription(int slot)
    {
        int    id   = pinfo.GetAbilityID(slot);
        string desc = "";

        //Debug.Log("SLOT" + slot+"ID"+id);
        switch (id)
        {
        case 1:     //frenzy
            Frenzy frenzy = (Frenzy)pinfo.abilities[slot];
            frenzy.CalculateMult();
            desc = frenzy.GetDescription();
            break;

        case 2:     //rage
            Rage rage = (Rage)pinfo.abilities[slot];
            rage.CalculateMult();
            desc = rage.GetDescription();
            break;


        case 3:     //Mine
            Mine mine = (Mine)pinfo.abilities[slot];
            mine.CalculateDamage();
            desc = mine.GetDescription();
            break;

        case 4:     //Mine
            Fireball fireball = (Fireball)pinfo.abilities[slot];
            fireball.CalculateDamage();
            desc = fireball.GetDescription();
            break;
        }
        return(desc);
    }
Esempio n. 10
0
 void initializeSpells()
 {
     dash       = gameObject.AddComponent(typeof(Dash)) as Dash;
     rage       = gameObject.AddComponent(typeof(Rage)) as Rage;
     spinAttack = gameObject.AddComponent(typeof(SpinAttack)) as SpinAttack;
     cut        = gameObject.AddComponent(typeof(Cut)) as Cut;
     cripple    = gameObject.AddComponent(typeof(Cripple)) as Cripple;
 }
Esempio n. 11
0
    // évênnement de départ
    void Start()
    {
        rageRef    = perso.GetComponent <Rage>();
        vieMaxBase = perso.GetComponent <joueur>().pointDeVieMax;

        infoEvent2.ExpMax        = experienceMax;
        infoEvent2.ExpNextNiveau = experienceMax;
    }
Esempio n. 12
0
 void Start()
 {
     lvlTitle.text = SceneManager.GetActiveScene().name;
     waveCountdown = timeBetweenWaves;
     rageScript    = GetComponent <Rage>();
     currentLvl    = SceneManager.GetActiveScene().buildIndex;
     //listCount = enemies.Count;
 }
Esempio n. 13
0
 private void Start()
 {
     Cursor.visible   = true;
     Cursor.lockState = CursorLockMode.Locked;
     collisionEvents  = new List <ParticleCollisionEvent>();
     particleSystem   = GetComponent <ParticleSystem>();
     rage             = GetComponent <Rage>();
 }
Esempio n. 14
0
 //préInitialisation ce certaines données
 void Awake()
 {
     rageRef               = gameObject.GetComponent <Rage>();
     initInfoEvent.Cible   = gameObject;
     initInfoEvent.HP      = pointDeVie;
     initInfoEvent.HPMax   = pointDeVieMax;
     initInfoEvent.Rage    = rageRef.pointsDeRage;
     initInfoEvent.RageMax = rageRef.pointsDeRageMax;
     SystemeEvents.Instance.LancerEvent(NomEvent.initEvent, initInfoEvent);
 }
Esempio n. 15
0
        public Skill CreateSkill(Player player)
        {
            List <Skill> playerSkills = player.ListOfSkills;
            Skill        known        = CheckContent(playerSkills);

            if (known == null)
            {
                Bloodlust s1 = new Bloodlust();
                Heal      s2 = new Heal();
                Rage      s3 = new Rage();

                List <Skill> tmp = new List <Skill>();
                if (s1.MinimumLevel <= player.Level)
                {
                    tmp.Add(s1);
                }
                if (s2.MinimumLevel <= player.Level)
                {
                    tmp.Add(s2);
                }
                if (s3.MinimumLevel <= player.Level)
                {
                    tmp.Add(s3);
                }
                if (tmp.Count == 0)
                {
                    return(null);
                }
                return(tmp[Index.RNG(0, tmp.Count)]);
            }
            else if (known.decoratedSkill == null)
            {
                BloodlustDecorator s1  = new BloodlustDecorator(known);
                HealDecorator      s2  = new HealDecorator(known);
                RageDecorator      s3  = new RageDecorator(known);
                List <Skill>       tmp = new List <Skill>();
                if (s1.MinimumLevel <= player.Level)
                {
                    tmp.Add(s1);
                }
                if (s3.MinimumLevel <= player.Level)
                {
                    tmp.Add(s3);
                }
                if (tmp.Count == 0)
                {
                    return(null);
                }
                return(tmp[Index.RNG(0, tmp.Count)]);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 16
0
        public static T PointerToStruct <T>(IntPtr pointer, bool freePointer = true)
        {
            var value = Marshal.PtrToStructure <T>(pointer);

            if (freePointer)
            {
                Rage.FreeObject(pointer);
            }

            return(value);
        }
Esempio n. 17
0
    //private Health healthBoss;
    //Scrollbar healthBossBar;
    void Start()
    {
        GameObject player = GameObject.Find("Player");

        health = player.GetComponent <Health>();
        mana   = player.GetComponent <Mana>();
        rage   = player.GetComponent <Rage>();

        //Falta la barra de vida del Boss
        //healthBoss = GameObject.Find("Boos").GetComponent<Health>();
    }
Esempio n. 18
0
/*
 * This method will initialise the zombie FSM.
 */
    void Start()
    {
        attackTimer = 5f;
        animator    = GetComponent <Animator>();
        myTransform = transform;
        agent       = GetComponent <NavMeshAgent>();
        state       = State.WANDER;
        rage        = FindObjectOfType <Rage>();
        player      = GameObject.FindGameObjectWithTag("Player");
        audioS      = GetComponent <AudioSource>();
        maxDistance = 200f;
    }
        public Warrior(Race race, Level level) : base(race, level)
        {
            Rage = new Rage(100);
            PrimaryAttributes   = CalculatePrimaryAttributes(level);
            SecondaryAttributes = CalculateSecondaryAttributes(PrimaryAttributes);

            // 5 point Defense cap increase per level, we are assuming maximum is achieved.
            SecondaryAttributes.Defense.Add(Level.Value * 5);
            // Get all weapon skills, capped at the maximum for the players level.
            var maxWeaponSkillsForLevel = WeaponSkill.GetWeaponSkills(Level);

            SecondaryAttributes.WeaponSkills.Add(maxWeaponSkillsForLevel);
        }
Esempio n. 20
0
 private void Start()
 {
     enemyBehavior     = GetComponent <EnemyBehavior>();
     rageScript        = this.gameObject.GetComponentInParent <Rage>();
     animator          = this.gameObject.GetComponent <Animator>();
     makeSnowballTimer = makeSnowball + Random.Range(0f, timerRandomizer);
     windUpTimer       = windUp;
     throwBallTimer    = throwBall;
     if (startingGun != null)
     {
         EquipGun(startingGun);
     }
 }
Esempio n. 21
0
    void CheckForRageColliding(Collision2D collision)
    {
        Rage rage = collision.gameObject.GetComponent <Rage>();

        if (!rage)
        {
            return;
        }

        if (rage.abilityActive)
        {
            Destroy(gameObject);
        }
    }
Esempio n. 22
0
    private void Awake()
    {
        _hero         = FindObjectOfType <Hero>();
        _distanceRage = FindObjectOfType <Minotaur>().distanceRage;
        _magicRage    = FindObjectOfType <Minotaur>().magicRage;

        // Choose familier level based on distance / magic rage
        _index = Mathf.Max(_distanceRage.FillRatio, _magicRage.FillRatio) / 34;
        Debug.Log(_index);

        _fireDelay             = 1 / familierDatas[_index].fireFrequency;
        _lifeTime              = familierDatas[_index].lifeTime;
        _orbitRadius           = familierDatas[_index].orbitRadius;
        _orbitTime             = familierDatas[_index].orbitTime;
        _radiusEvolutionFactor = familierDatas[_index].radiusEvolutionFactor;
    }
Esempio n. 23
0
    void CheckForRampageCollision(Collider2D collision)
    {
        Rage rage = collision.gameObject.GetComponent <Rage>();

        if (!rage)
        {
            return;
        }

        if (!rage.abilityActive)
        {
            return;
        }

        Activate();
    }
Esempio n. 24
0
    public void DoSome(string button)
    {
        lastClicked = button;

        switch (button)
        {
        case "ResetChoises": ResetAll(); break;

        case "Long Sword":
            SetWeaponDescription(button, "3.2", "2", null); break;

        case "Dagger":
            SetWeaponDescription(button, "1.6", "1", null); break;

        case "Throwing Knifes":
            SetWeaponDescription(button, "0.8", "1", "3"); break;

        case "Javelin":
            SetWeaponDescription(button, "2.4", "2.1", "4"); break;

        case "Bow":
            SetWeaponDescription(button, "1.25", "1.8", "5"); break;

        case "Unarmed":
            SetWeaponDescription(button, "0.8", "0.5", null); break;

        case "Frenzy":
            descHeader.text = button; Frenzy frenzy = new Frenzy();
            descText.text   = frenzy.GetDescription();
            break;

        case "Rage":
            descHeader.text = button; Rage rage = new Rage();
            descText.text   = rage.GetDescription();
            break;

        case "Magical Mine":
            descHeader.text = button; Mine mine = new Mine();
            descText.text   = mine.GetDescription();
            break;

        case "Fireball":
            descHeader.text = button; Fireball fireball = new Fireball();
            descText.text   = fireball.GetDescription();
            break;
        }
    }
Esempio n. 25
0
    void CheckForRampageCollision(Collider2D collision)
    {
        Rage rage = collision.gameObject.GetComponent <Rage>();

        if (!rage)
        {
            return;
        }

        if (!rage.abilityActive)
        {
            return;
        }

        Activate();
        gameManager.sceneManager.RetryLevelOnKill();
    }
Esempio n. 26
0
    void DeactivateBuff(int slot)
    {
        int id = pinfo.abilities[slot].GetID();

        switch (id)
        {
        case 1:
            Frenzy frenzy = (Frenzy)pinfo.abilities[slot];
            frenzy.Reset();
            break;

        case 2:
            Rage rage = (Rage)pinfo.abilities[slot];
            rage.Reset();
            break;
        }
    }
 public Warrior()
 {
     hpBar = new HealthBar(this);
     tag   = "Player";
     animation.spriteArray = ContentCollection.warrior;
     spriteSize            = new Vector2(35, 80);
     gamePosition          = new Vector2(200, 350);
     movementSpeed         = 150;
     maxHealth             = 100;
     currentHealth         = maxHealth;
     healthRegen           = 1;
     damage          = 50;
     primaryAttack   = new SwordSlash(this);
     secondaryAttack = new Rage(this);
     attackSpeed     = 1;
     secondaryCD     = 10;
     StartThread();
 }
Esempio n. 28
0
 public Berserker()
 {
     heroTexture = Engine.Engine.GetTexture("Hero/Berserker");
     Hero.loadSprite();
     heroRole            = Classes.Berserker;
     baseHealth          = 500;
     healthPerLevel      = 40;
     requiredBranchLevel = int.MaxValue;
     resetLevel();
     resetHealth();
     abilities[0] = new Cleave();
     abilities[1] = new WhirlwindSlash();
     abilities[2] = new Slam();
     abilities[3] = new DoubleSlash();
     abilities[4] = new Rage();
     abilities[5] = new Execute();
     Enemies.Enemy.UpdateTargets(this);
     Enemies.BossEnemy.UpdateBossTargets(this);
 }
Esempio n. 29
0
    void UtilizeAbility(int slot)
    {
        bool cooldownActive = pinfo.abilities[slot].coolDown.GetActivity();
        int  mpCost         = pinfo.abilities[slot].GetCostMP();

        if (!cooldownActive && pinfo.stats.mpCur > mpCost)
        {
            cooldownImg[slot].gameObject.SetActive(true);
            int id = pinfo.abilities[slot].GetID();
            switch (id)
            {
            case 1:
                Frenzy frenzy = (Frenzy)pinfo.abilities[slot];
                frenzy.Activate();
                break;

            case 2:
                Rage rage = (Rage)pinfo.abilities[slot];
                rage.Activate();
                break;

            case 3:
                Mine mine = (Mine)pinfo.abilities[slot];
                mine.Activate();
                break;

            case 4:
                Fireball   fireball = (Fireball)pinfo.abilities[slot];
                PlayerInfo target   = Target.GetTargetUnit();
                if (target != null)
                {
                    fireball.Activate();
                }
                break;
            }
        }
    }
Esempio n. 30
0
    void CheckForRampageCollision(Collision2D collision)
    {
        if (!collision.gameObject.CompareTag("Character"))
        {
            return;
        }

        if (collision.gameObject.name != "Rage")
        {
            return;
        }

        if (!rage)
        {
            rage = collision.gameObject.GetComponent <Rage>();
        }

        if (!rage.abilityActive)
        {
            return;
        }

        RampageColliding();
    }
Esempio n. 31
0
    public void ActivateOnRampageTrigger(Collider2D collision)
    {
        if (actionActivated)
        {
            return;
        }

        if (!collision.gameObject.CompareTag("Character"))
        {
            return;
        }

        Rage rage = collision.gameObject.GetComponent <Rage>();

        if (!rage)
        {
            return;
        }

        if (rage.abilityActive)
        {
            Activate();
        }
    }
Esempio n. 32
0
    public void InstantiateAbilities()
    {
        for (int i = 0; i < DataTransferManager.dataHolder.abilId.Length; i++)
        {
            switch (DataTransferManager.dataHolder.abilId[i])
            {
            case 1:
                abilities[i] = new Frenzy(i, this, DataTransferManager.dataHolder.abilLv[i]);
                break;

            case 2:
                abilities[i] = new Rage(i, this, DataTransferManager.dataHolder.abilLv[i]);
                break;

            case 3:
                abilities[i] = new Mine(i, this, DataTransferManager.dataHolder.abilLv[i]);
                break;

            case 4:
                abilities[i] = new Fireball(i, this, DataTransferManager.dataHolder.abilLv[i]);
                break;
            }
        }
    }
Esempio n. 33
0
 public PedBase(string pName, Rage.Vector3 position) : this(pName, Common.PedType.Unknown, position)
 {
 }
Esempio n. 34
0
 private void Start()
 {
     rageDollPool = GameObject.Find(("RageDollPool")).transform;
     sounds       = GetComponentInChildren <PlayerBaseSounds>();
     playerRage   = GameObject.Find("Player").GetComponent <Rage>();
 }
Esempio n. 35
0
 public PedBase(string pName, Rage.Model model, Rage.Vector3 position, float heading) : this(pName, Common.PedType.Unknown, model, position, heading)
 {
 }
Esempio n. 36
0
 protected internal PedBase(string pName, Rage.PoolHandle handle) : this(pName, Common.PedType.Unknown, handle)
 {
 }
Esempio n. 37
0
 protected internal PedBase(string pName, Common.PedType pType, Rage.PoolHandle handle) : base(handle)
 {
     Name = pName;
     Type = pType;
     Init();
 }
Esempio n. 38
0
 public PedBase(string pName, Common.PedType pType, Rage.Vector3 position) : base(position)
 {
     Name = pName;
     Type = pType;
     Init();
 }
Esempio n. 39
0
 /// <summary>
 /// Draws a custom texture from a file on a 1080-pixels height base.
 /// </summary>
 /// <param name="texture">Your custom texture object.</param>
 /// <param name="position"></param>
 /// <param name="size"></param>
 /// <param name="graphics"></param>
 public static void DrawTexture(Texture texture, Point position, Size size, Rage.Graphics graphics)
 {
     var origRes = Game.Resolution;
     float aspectRaidou = origRes.Width / (float)origRes.Height;
     PointF pos = new PointF(position.X / (1080 * aspectRaidou), position.Y / 1080f);
     SizeF siz = new SizeF(size.Width / (1080 * aspectRaidou), size.Height / 1080f);
     graphics.DrawTexture(texture, pos.X * Game.Resolution.Width, pos.Y * Game.Resolution.Height, siz.Width * Game.Resolution.Width, siz.Height * Game.Resolution.Height);
 }
Esempio n. 40
0
        public void DrawTextures(Rage.Graphics g)
        {
            if (!Visible) return;

            Tabs[Index].DrawTextures(g);
        }
Esempio n. 41
0
        /// <summary>
        /// Draw your custom banner.
        /// <para>
        /// To prevent flickering call it inside a <see cref="Game.RawFrameRender"/> event handler.
        /// </para>
        /// </summary>
        /// <param name="g">The <see cref="Rage.Graphics"/> to draw on.</param>
        public void DrawBanner(Rage.Graphics g)
        {
            if (!Visible || _customBanner == null) return;
            var origRes = Game.Resolution;
            float aspectRaidou = origRes.Width / (float)origRes.Height;

            Point bannerPos = new Point(_offset.X + safezoneBounds.X, _offset.Y + safezoneBounds.Y);
            Size bannerSize = new Size(431 + WidthOffset, 107);

            PointF pos = new PointF(bannerPos.X / (1080 * aspectRaidou), bannerPos.Y / 1080f);
            SizeF siz = new SizeF(bannerSize.Width / (1080 * aspectRaidou), bannerSize.Height / 1080f);

            //Bug: funky positionment on windowed games + max resolution.
            g.DrawTexture(_customBanner, pos.X * Game.Resolution.Width, pos.Y * Game.Resolution.Height, siz.Width * Game.Resolution.Width, siz.Height * Game.Resolution.Height);
        }
 public override void DrawTextures(Rage.Graphics g)
 {
     if (drawTexture)
     {
         Sprite.DrawTexture(Heists[Index].Logo.Texture, new Point((int)res.Width - SafeSize.X - 512, SafeSize.Y), new Size(512, 256), g);
     }
 }
Esempio n. 43
0
 public PedBase(string pName, Common.PedType pType, Rage.Model model, Rage.Vector3 position, float heading) : base(model, position, heading)
 {
     Name = pName;
     Type = pType;
     Init();
 }