Inheritance: MonoBehaviour
Exemple #1
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var r = rest.GetEnumerator();

            if (!r.MoveNext())
            {
                return;
            }

            var level = int.Parse(r.Current);

            String what;

            if (level == 0)
            {
                what = $"{from} cleared your wanted level!";
            }
            else if (level == 1)
            {
                what = $"{from} set your wanted level to one star!";
            }
            else
            {
                what = $"{from} set your wanted level to {level} stars!";
            }

            Game.Player.WantedLevel = level;
            mod.ShowText(what);
        }
Exemple #2
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Player player      = Game.Player;
            Model  playerModel = Game.Player.Character.Model;

            player.ToggleSpecialAbility(false);
        }
Exemple #3
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped    player = Game.Player.Character;
            Weapon weapon = player.Weapons.Current;

            if (weapon != null)
            {
                player.Weapons.Remove(weapon);
            }
            else
            {
                var weapons = mod.PlayerWeapons();

                if (weapons.Count == 0)
                {
                    mod.ShowText($"{from} tried to take your weapons, but no weapons to take :(");
                    return;
                }

                var take = weapons[mod.Rnd.Next(0, weapons.Count - 1)];
                // take a random weapon.
                player.Weapons.Remove(take);
            }

            player.Weapons.Select(WeaponHash.Unarmed, true);
            // mod.ShowText($"{from} took your weapon!");
        }
Exemple #4
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var r = rest.GetEnumerator();

            if (!r.MoveNext())
            {
                return;
            }

            String          what    = null;
            DisabledControl control = DisabledControl.Steering;

            var id = r.Current;

            switch (id)
            {
            case "steering":
                control = DisabledControl.Steering;
                what    = "Steering";
                break;

            default:
                throw new Exception($"bad disable-control id `{id}`");
            }

            var timer = mod.Timer($"Disabled {what}", 10f);

            mod.AddTicker(new DisableControlTicker(timer, control));
            mod.ShowText($"{from} disabled the {what} control!");
        }
Exemple #5
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            if (player == null)
            {
                return;
            }

            var r = rest.GetEnumerator();

            if (!r.MoveNext())
            {
                return;
            }

            var id = r.Current;

            WeaponHash?weapon = mod.GetWeaponById(id);

            if (!weapon.HasValue)
            {
                mod.ShowText($"{from} tried to give you a weapon :( ({id})");
                return;
            }

            var w = player.Weapons.Give(weapon.Value, 0, true, true);

            w.Ammo       = w.MaxAmmo;
            w.AmmoInClip = w.MaxAmmoInClip;
            mod.ShowText($"{from} gave you a weapon! ({id})");
        }
Exemple #6
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            if (player == null)
            {
                return;
            }

            var vehicle = player.CurrentVehicle;

            if (vehicle == null)
            {
                return;
            }

            var license = String.Join(" ", rest);

            if (license.Length == 0)
            {
                license = from;
            }

            license = String.Concat(license.Take(8));

            vehicle.Mods.LicensePlate = license;
            mod.ShowText($"{from} set your license plate to \"{license}\"!");
        }
Exemple #7
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            if (player == null)
            {
                mod.ShowText($"{from} tried to boost you :(");
                return;
            }

            var   what   = "Boost";
            float time   = 30f;
            float factor = 20f;

            if (super)
            {
                factor = 200f;
                what   = "Super Boost";
            }

            var timer = mod.Timer(what, time);

            mod.AddTicker(new BoostTicker(player, timer, factor));
            mod.ShowText($"{from} caused the vehicle to boost!");
        }
Exemple #8
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            player.Euphoria.StaggerFall.Start(500);
            mod.ShowText($"{from} tripped you!");
        }
Exemple #9
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            player.Euphoria.ShotInGuts.Start(500);
            mod.TakeHealth();
        }
Exemple #10
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var timer = mod.Timer("Reduced Gravity", 15);

            World.GravityLevel = 9.8f / 2;
            mod.AddUniqueTicker(TickerId.ReducedGravity, new Ticker(timer));
        }
Exemple #11
0
 public Currency(Blacksmith_whetstone blacksmith_whetstone, Armourer_scrap armourer_scrap, Glassblower_bauble glassblower_bauble, Gemcutter_prism gemcutter_prism, Cartographer_chisel cartographer_chisel, Transmutation transmutation, Alteration alteration, Annulment annulment, Chance chance, Augment augment, Exalted exalted, Mirror mirror, Regal regal, Alchemy alchemy, Chaos chaos, Blessed blessed, Divine divine, Jeweller jeweller, Fusing fusing, Chromatic chromatic, Scouring scouring, Regret regret, Vaal vaal, Silver_coin silver_coin, Perandus_coin perandus_coin, Apprentice_sextant apprentice_sextant, Journeyman_sextant journeyman_sextant, Master_sextant master_sextant)
 {
     this.blacksmith_whetstone = blacksmith_whetstone;
     this.armourer_scrap       = armourer_scrap;
     this.glassblower_bauble   = glassblower_bauble;
     this.gemcutter_prism      = gemcutter_prism;
     this.cartographer_chisel  = cartographer_chisel;
     this.transmutation        = transmutation;
     this.alteration           = alteration;
     this.annulment            = annulment;
     this.chance             = chance;
     this.augment            = augment;
     this.exalted            = exalted;
     this.mirror             = mirror;
     this.regal              = regal;
     this.alchemy            = alchemy;
     this.chaos              = chaos;
     this.blessed            = blessed;
     this.divine             = divine;
     this.jeweller           = jeweller;
     this.fusing             = fusing;
     this.chromatic          = chromatic;
     this.scouring           = scouring;
     this.regret             = regret;
     this.vaal               = vaal;
     this.silver_coin        = silver_coin;
     this.perandus_coin      = perandus_coin;
     this.apprentice_sextant = apprentice_sextant;
     this.journeyman_sextant = journeyman_sextant;
     this.master_sextant     = master_sextant;
 }
Exemple #12
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped     player  = Game.Player.Character;
            Vehicle vehicle = player.CurrentVehicle;

            if (vehicle == null)
            {
                mod.ShowText($"{from} tried to blow out your tires!");
                return;
            }

            if (!vehicle.CanTiresBurst)
            {
                vehicle.CanTiresBurst = true;
            }

            var wheels = vehicle.Wheels;

            foreach (var i in WHEELS)
            {
                if (vehicle.IsVehicleTyreBurst(i, true))
                {
                    continue;
                }

                if (mod.Rnd.NextBoolean())
                {
                    wheels[i].Burst();
                }
            }

            mod.ShowText($"{from} blew out your tires!");
        }
Exemple #13
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            if (player == null)
            {
                return;
            }

            var vehicle = player.CurrentVehicle;

            if (vehicle == null)
            {
                return;
            }

            var count = vehicle.Mods.ColorCombinationCount;

            if (count == 0)
            {
                vehicle.Mods.ColorCombination = mod.Rnd.Next(0, count);
            }

            vehicle.RandomizeColors(mod.Rnd);
            mod.ShowText($"{from} scrambled your vehicle colors!");
        }
 public override void DrawLine(CommonGui.Drawing.Pen pen, Chaos.Util.Mathematics.Vector2f p1, Chaos.Util.Mathematics.Vector2f p2)
 {
     using (System.Drawing.Pen pen2 = CreatePen(pen))
     {
         InternalGraphics.DrawLine(pen2, p1.Convert(), p2.Convert());
     }
 }
Exemple #15
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            player.Euphoria.HighFall.Start(1000);
            mod.ShowText($"{from} caused you to fall!");
        }
Exemple #16
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var player = Game.Player.Character;

            if (player == null)
            {
                mod.ShowText($"{from} tried to make you skyfall :(");
                return;
            }

            // parameters when in vehicle
            if (player.CurrentVehicle != null)
            {
                player.CurrentVehicle.Delete();
            }

            switch (player.ParachuteState)
            {
            case ParachuteState.Deploying:
            case ParachuteState.Gliding:
                player.Task.UseParachute();
                break;

            default:
                break;
            }

            var timer = mod.Timer("Skyfall", 20f);

            player.Weapons.Give(WeaponHash.Parachute, 1, true, true);
            mod.AddUniqueTicker(TickerId.Skyfall, new SkyfallTicker(player, timer));
        }
Exemple #17
0
 public void Handle(Chaos mod, String from, IEnumerable <String> rest)
 {
     mod.Call(from, "internal", "exploding-punches", rest);
     mod.Call(from, "internal", "super-speed", rest);
     mod.Call(from, "internal", "super-jump", rest);
     mod.Call(from, "internal", "super-swim", rest);
     mod.Call(from, "internal", "invincibility", rest);
 }
Exemple #18
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var duration = rest.GetEnumerator().NextFloatOrDefault(30f);
            var timer    = mod.Timer("Super Swim", duration);

            mod.AddUniqueTicker(TickerId.SuperSwim, new SuperSwimTicker(timer, 10f));
            mod.ShowText($"{from} gave you with super swim for {duration} seconds");
        }
Exemple #19
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var duration = rest.GetEnumerator().NextFloatOrDefault(30f);
            var timer    = mod.Timer("Exploding Bullets", duration);

            mod.AddUniqueTicker(TickerId.ExplodingBullets, new ExplodingBulletsTicker(timer));
            mod.ShowText($"{from} enabled exploding bullets!");
        }
 public override void DrawString(string text, CommonGui.Drawing.Font font, Chaos.Image.RawColor color, Vector2f position)
 {
     using (System.Drawing.Font font2 = CreateFont(font))
     {
         using (System.Drawing.Brush brush = CreateBrush(color))
         {
             InternalGraphics.DrawString(text, font2, brush, new System.Drawing.PointF(position.X, position.Y));
         }
     }
 }
Exemple #21
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var player = Game.Player.Character;

            if (player == null)
            {
                return;
            }

            var r = rest.GetEnumerator();

            if (!r.MoveNext())
            {
                return;
            }

            var amount = int.Parse(r.Current);

            for (var i = 0; i < amount; i++)
            {
                var pedHash    = ENEMY_MODELS[mod.Rnd.Next(0, ENEMY_MODELS.Length)];
                var weaponHash = ENEMY_WEAPONS[mod.Rnd.Next(0, ENEMY_WEAPONS.Length)];

                var distance = mod.Rnd.Next(10, 20);

                var ped    = World.CreatePed(new Model(pedHash), player.Position.Around(distance));
                var weapon = ped.Weapons.Give(weaponHash, 0, true, true);
                weapon.Ammo = weapon.MaxAmmo;

                ped.IsEnemy           = true;
                ped.RelationshipGroup = mod.HateGroup.GroupId;

                ped.SetCombatAttributes(CombatAttributes.AlwaysFight, true);
                ped.SetCombatAttributes(CombatAttributes.CanFightArmedPedsWhenNotArmed, true);

                ped.Task.ClearAll();
                ped.Task.FightAgainst(player);

                ped.Detach();
                ped.MarkAsNoLongerNeeded();

                var blip = ped.AttachBlip();
                mod.AddTicker(new EnemyBlipTicker(blip, ped));
            }

            if (amount == 1)
            {
                mod.ShowText($"{from} spawned an fib operative out to get you!");
            }
            else
            {
                mod.ShowText($"{from} spawned {amount} fib operatives out to get you!");
            }
        }
Exemple #22
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var timer = mod.Timer("Time Slowdown", 5f);

            if (mod.AddUniqueTicker(TickerId.SlowDownTime, new SlowDownTimeTicker(timer)))
            {
                Function.Call(Hash.SET_TIME_SCALE, 0.25f);
            }

            mod.ShowText($"{from} slowed down time!");
        }
Exemple #23
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var r        = rest.GetEnumerator();
            var duration = rest.GetEnumerator().NextFloatOrDefault(30f);

            var player = Game.Player;

            var timer = mod.Timer("Super Jump", duration);

            mod.AddUniqueTicker(TickerId.SuperJump, new SuperJumpTicker(timer, player));
            mod.ShowText($"{from} gave you with super jump for {duration} seconds");
        }
Exemple #24
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var      hours          = mod.Rnd.Next(0, 23);
            var      minutes        = mod.Rnd.Next(0, 59);
            var      seconds        = mod.Rnd.Next(0, 59);
            TimeSpan currentDayTime = new TimeSpan(hours, minutes, seconds);

            World.CurrentTimeOfDay = currentDayTime;
            World.Weather          = ALL_WEATHERS[mod.Rnd.Next(0, ALL_WEATHERS.Length)];

            mod.ShowText($"{from} scrambled the current weather!");
        }
Exemple #25
0
 private Chaos[] CreateChaos(int width, int height, int count)
 {
     Chaos[] chaos = new Chaos[count];
     for (int i = 0; i < count; i++)
     {
         chaos[i] = new Chaos(
             _random.Next(2, width - 2),
             _random.Next(2, height - 2),
             CreateColor(20, 240));
     }
     return(chaos);
 }
Exemple #26
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var duration = rest.GetEnumerator().NextFloatOrDefault(30f);
            var timer    = mod.Timer("Super Speed", duration);

            if (mod.AddUniqueTicker(TickerId.SuperSpeed, new SuperSpeedTicker(timer)))
            {
                // NB: in spite of its name, it should only be called once.
                Game.Player.SetRunSpeedMultThisFrame(10f);
            }

            mod.ShowText($"{from} gave you super speed for {duration} seconds");
        }
Exemple #27
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            if (player == null)
            {
                mod.ShowText($"{from} tried to kill you!");
                return;
            }

            player.Kill();
            mod.ShowText($"{from} killed you!");
        }
Exemple #28
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var player = Game.Player.Character;

            if (player == null)
            {
                mod.ShowText($"{from} tried to open your parachute!");
                return;
            }

            player.Task.UseParachute();
            mod.ShowText($"{from} opened your parachute!");
        }
Exemple #29
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            if (player == null)
            {
                mod.ShowText($"{from} tried to take your weapons!");
                return;
            }

            player.Weapons.RemoveAll();
            mod.ShowText($"{from} took ALL your weapons!");
        }
Exemple #30
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            Ped player = Game.Player.Character;

            if (player == null)
            {
                mod.ShowText($"{from} tried to give you armor!");
                return;
            }

            player.Health = player.MaxHealth;
            mod.ShowText($"{from} gave you armor!");
        }
Exemple #31
0
        /// <summary>
        /// Serializes the object to JSON.
        /// </summary>
        /// <param name="writer">The <see cref="T: Newtonsoft.Json.JsonWriter" /> to write to.</param>
        /// <param name="obj">The object to serialize to JSON.</param>
        internal static void Serialize(JsonWriter writer, Chaos obj)
        {
            // Required properties are always serialized, optional properties are serialized when not null.
            writer.WriteStartObject();
            writer.WriteProperty(obj.Status, "Status", ChaosStatusConverter.Serialize);
            writer.WriteProperty(obj.ScheduleStatus, "ScheduleStatus", ChaosScheduleStatusConverter.Serialize);
            if (obj.ChaosParameters != null)
            {
                writer.WriteProperty(obj.ChaosParameters, "ChaosParameters", ChaosParametersConverter.Serialize);
            }

            writer.WriteEndObject();
        }
Exemple #32
0
        public void Handle(Chaos mod, String from, IEnumerable <String> rest)
        {
            var player  = Game.Player.Character;
            var vehicle = player?.CurrentVehicle;

            if (player == null || vehicle == null)
            {
                mod.ShowText($"{from} tried to eject from vehicle :(");
                return;
            }

            player.Task.LeaveVehicle();
            mod.ShowText($"{from} caused you to eject from your vehicle!");
        }
    private string GetRelatedObjectsFreeText(Chaos.Mcm.Data.Dto.Object obj)
    {
      if (obj.ObjectRelationInfos == null)
        return string.Empty;

      var output = " ";

      foreach (
        var relatedObj in
          obj.ObjectRelationInfos.Where(
            robj => robj.Object2TypeID == AnnotationObjectId || robj.Object2TypeID == AttachedFileObjectId))
      {
        output = output + GetAnnotationMetadata(relatedObj.Object2Guid);
      }

      return output;
    }
Exemple #34
0
 void Awake()
 {
     _avatarController = GetComponent<AvatarController>();
     _attraction = GetComponent<Chaos>();
 }
 public override void FillRectangle(Chaos.Image.RawColor color, Chaos.Util.Mathematics.RectangleF rect)
 {
     using (System.Drawing.Brush brush2 = CreateBrush(color))
     {
         InternalGraphics.FillRectangle(brush2, rect.Convert());
     }
 }
Exemple #36
0
 void Awake()
 {
     //GC = GameObject.Find("GameVariables").GetComponent<GameController>();
     player = GameObject.Find ("First Person Controller");
     playerChaos = player.GetComponent<Chaos>();
 }