From a25ec76d6beff38af41d4eb38b2b90595d8739cb Mon Sep 17 00:00:00 2001 From: lempamo Date: Mon, 3 Aug 2020 15:08:14 -0400 Subject: [PATCH] mod aint dead (yet) --- ChaosMain.cs | 32 +++++++++++++++++++------------- README.md | 2 ++ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ChaosMain.cs b/ChaosMain.cs index 85a7c3c..e056bb9 100644 --- a/ChaosMain.cs +++ b/ChaosMain.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; +using System.IO.Pipes; using System.Linq; using System.Linq.Expressions; using System.Runtime.CompilerServices; @@ -100,6 +102,11 @@ public class ChaosMain : Script { bool isHUDless = false; int lagTicks = 0; + bool twitchVoting = false; + NamedPipeServerStream twitchPipe = new NamedPipeServerStream("twitch-chaosiv-pipe", PipeDirection.InOut, 1, PipeTransmissionMode.Message, PipeOptions.Asynchronous); + byte[] twitchBuffer; + List twitchEffectTrio = new List(3); + public ChaosMain() { Interval = 16; Tick += new EventHandler(ChaosLoop); @@ -127,7 +134,6 @@ public ChaosMain() { Effects.Add(new Effect("Earthquake", EffectMiscEarthquake, new Timer(28000), EffectMiscEarthquake, EffectMiscEarthquake)); Effects.Add(new Effect("Invert Current Velocity", EffectMiscInvertVelocity)); - //Effects.Add(new Effect("Zero Gravity", EffectMiscNoGravity, new Timer(28000), null, EffectMiscNormalGravity)); //this one doesn't affect vehicles :/ Effects.Add(new Effect("No HUD", EffectMiscNoHUD, new Timer(88000), null, EffectMiscShowHUD)); Effects.Add(new Effect("Nothing", EffectMiscNothing)); Effects.Add(new Effect("Spawn Jet", EffectMiscSpawnJet)); @@ -230,6 +236,17 @@ public ChaosMain() { Effects.Add(new Effect("Sunny Weather", EffectWeatherSunny)); Effects.Add(new Effect("Stormy Weather", EffectWeatherThunder)); + + // Settings Time + var dE = Settings.GetValueString("disabledEffects").Split(','); + + if (dE[0] != "") + foreach (string e in dE) { + Effects.Remove(Effects.Find(x => x.Name == e)); + Game.Console.Print("Disabled effect \"" + e + "\"."); + } + + EffectTimer = new Timer(); EffectTimer.Tick += new EventHandler(DeployEffect); EffectTimer.Interval = 30000; @@ -370,23 +387,12 @@ public void EffectMiscInvertVelocity() { } } - public void EffectMiscNoGravity() { - // floating free... - // one, two, three... - // eternity.... - World.GravityEnabled = false; - } - public void EffectMiscNoHUD() { isHUDless = true; Function.Call("DISPLAY_HUD", false); Function.Call("DISPLAY_RADAR", false); } - public void EffectMiscNormalGravity() { - World.GravityEnabled = true; - } - public void EffectMiscNothing() { Game.Console.Print("ok maybe not quite \"nothing\" but eh who cares"); } @@ -587,7 +593,7 @@ public void EffectPedsOHKO() { p.Health = 5; p.Armor = 0; } - if (p == Player) { + if (p == Player && p.Health > 5) { p.Health = 1; p.Armor = 0; } diff --git a/README.md b/README.md index 3dd559d..f205f7e 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ *ChaosIV* is a Chaos mod for Grand Theft Auto IV inspired by similar mods for GTA V and GTA:SA. The mod has been tested to work with 1.0.4.0 and 1.0.7.0, though it may likely also work with 1.0.8.0 and the Complete Edition. +A list of implemented effects can be found here: https://docs.google.com/spreadsheets/d/16mKSpQb9KH387viPWK97ejFQ6xchB1lvvpeXNYW66rI/edit?usp=sharing + This mod requires an ASI loader and .NET ScriptHook in order to be installed. To install, simply drop the ChaosIV.net.dll file into the scripts folder within your GTA IV installation.