Ejemplo n.º 1
0
 public void Unlock()
 {
     if (RPG.PlayerData.SkillExp >= PointsToUnlock && RPG.PlayerData.Level >= LevelToUnlock)
     {
         RPG.PlayerData.SkillExp -= PointsToUnlock;
         Unlocked = true;
         RPG.GetPopup <WeaponUnlocked>().Show(this);
         EventHandler.Do(o =>
         {
             Game.Player.Character.Weapons.Give(WeaponHash, 0, false, false);
             Script.Wait(150);
             Game.Player.Character.Weapons[WeaponHash].Ammo = 100;
         });
     }
     else
     {
         if (RPG.PlayerData.SkillExp < PointsToUnlock)
         {
             RPG.Notify("Not enough SP");
         }
         else if (RPG.PlayerData.Level < LevelToUnlock)
         {
             RPG.Notify("Requires Level " + LevelToUnlock);
         }
     }
 }
Ejemplo n.º 2
0
        private static void GetHigh(Skill skill)
        {
            var rng = Random.Range(0, 100);

            SkillEventHandler.Do(x =>
            {
                Function.Call(Hash.SET_TIME_SCALE, rng < 80 ? 0.4f : 0.2f);
                Function.Call(Hash.SET_TIMECYCLE_MODIFIER, rng < 80 ? "phone_cam6" : "phone_cam7");
                var slowTime = skill.GetIntParam("Slow Time");
                if (rng > 80)
                {
                    RPG.Notify(Notification.Danger("Unlucky, what a hit! HP Lost"));
                    if (Game.Player.Character.Health > 10)
                    {
                        Game.Player.Character.Health -= 10;
                    }
                    else
                    {
                        Game.Player.Character.Health = 5;
                    }
                }
                SkillEventHandler.Wait(slowTime);
                Function.Call(Hash.SET_TIME_SCALE, 1f);
                Function.Call(Hash.SET_TIMECYCLE_MODIFIER, "");
            });
        }
Ejemplo n.º 3
0
        public static void UseSkill(Skill skill)
        {
            if (!skill.Unlocked)
            {
                RPG.Notify(Notification.Alert("You have not unlocked this skill."));
                return;
            }

            skill.Use(skill);

            //Cooldowns, mana use etc
        }
Ejemplo n.º 4
0
 public void Use(Skill obj)
 {
     if (CoolDownTimer.Usable)
     {
         SkillRepository.GetAction(Name).Invoke(obj);
         CoolDownTimer.Reset();
     }
     else
     {
         var secs = CoolDownTimer.SecondsRemaining.ToString("0.0");
         RPG.Notify("cannot use " + Name + " for " + secs + "s");
     }
 }
Ejemplo n.º 5
0
        public bool Use()
        {
            if (!Usable)
            {
                return(false);
            }
            if (CoolDownTimer.Usable)
            {
                ItemRepository.GetAction(Name).Invoke();
                CoolDownTimer.Reset();
                return(true);
            }

            var secs = CoolDownTimer.SecondsRemaining.ToString("0.0");

            RPG.Notify("cannot use " + Name + " for " + secs + "s");

            return(false);
        }
Ejemplo n.º 6
0
        public static void Loot(LootItem loot)
        {
            if (loot != null)
            {
                if (loot.Item.Type == ItemType.Money)
                {
                    var notification = Notification.Loot("Looted GTA$" + loot.Item.MoneyValue.ToString("N0"));
                    notification.Tracking = loot.Item.MoneyValue;
                    RPG.Notify(notification);
                    PlayerData.AddMoney(loot.Item.MoneyValue);
                    loot.Destroy();
                    Game.PlaySound("FocusOut", "HintCamSounds");
                }
                else
                {
                    RPG.Notify(Notification.Loot("Looted: " + loot.Name + " x" + loot.Item.Quantity));
                    PlayerData.AddItem(loot.Item);
                    loot.Destroy();
                    Game.PlaySound("FocusOut", "HintCamSounds");
                }
            }

            RPGInfo.NearbyLoot = null;
        }
Ejemplo n.º 7
0
        private string TextToShow(object o)
        {
            if (o is int)
            {
                var c = (int)o;
                switch (c)
                {
                case 0:
                case 1:
                    return("");

                case 2:
                    RPG.Notify(Notification.Kill("double kill + 2"));
                    RPG.PlayerData.AddExp(2);
                    RPG.Audio.PlayKillStreak("doublekill");
                    return("double kill");

                case 3:
                    RPG.Notify(Notification.Kill("multi kill + 4"));
                    RPG.PlayerData.AddExp(4);
                    RPG.Audio.PlayKillStreak("multikill");
                    return("multi kill");

                case 4:
                    RPG.Notify(Notification.Kill("mega kill + 8"));
                    RPG.PlayerData.AddExp(8);
                    RPG.Audio.PlayKillStreak("megakill");
                    return("mega kill");

                case 5:
                    RPG.Notify(Notification.Kill("ultra kill + 12"));
                    RPG.PlayerData.AddExp(12);
                    RPG.Audio.PlayKillStreak("ultrakill");
                    return("ultra kill");

                case 6:
                    RPG.Notify(Notification.Kill("monster kill + 24"));
                    RPG.PlayerData.AddExp(24);
                    RPG.Audio.PlayKillStreak("monsterkill");
                    return("m m m monster kill");

                case 7:
                    RPG.Notify(Notification.Kill("ludicrous kill + 48"));
                    RPG.PlayerData.AddExp(48);
                    RPG.Audio.PlayKillStreak("ludicrouskill");
                    return("ludicrous kill");

                case 8:
                    RPG.Notify(Notification.Kill("rampage kill + 60"));
                    RPG.PlayerData.AddExp(60);
                    RPG.Audio.PlayKillStreak("rampage");
                    return("rampage kill");

                case 9:
                    RPG.Notify(Notification.Kill("wicked sick + 80"));
                    RPG.PlayerData.AddExp(80);
                    RPG.Audio.PlayKillStreak("wickedsick");
                    return("wicked sick");

                case 10:
                    RPG.Notify(Notification.Kill("unstoppable + 100"));
                    RPG.PlayerData.AddExp(100);
                    RPG.Audio.PlayKillStreak("unstoppable");
                    return("unstoppable");
                }

                if (c > 10)
                {
                    RPG.Notify(Notification.Kill("holy shit + 100"));
                    RPG.PlayerData.AddExp(100);
                    RPG.Audio.PlayKillStreak("holyshit");
                    return("h o l y  s h i t");
                }
            }

            return((string)o);
        }
Ejemplo n.º 8
0
 protected override void OnFinish()
 {
     RPG.Notify("Good luck!");
 }