Shipwright/soh/soh/Enhancements/crowd-control/soh.cs
David Chavez 083ceb4423
Feature: Crowd Control Integration (#1568)
* Start effects

* Disable input to game when typing in console

* Add gravity support

* noUI placeholder

* Add rest of effects to console

* Remove z_play code

* Add rupee modification

* Add OneHit KO (#27)

* few fix and paper Link

* Better method and now use the reset flag

* Revert "Better method and now use the reset flag"

This reverts commit 2aafcc1df2.

* Revert "few fix and paper Link"

This reverts commit 65e76dcfee.

* Paper Link & few fixes (#28)

* Implement pacifist mode (#30)

* Implement cucco storm (#31)

* Add no UI functionality (#32)

* Enable CrowdControl on windows (#33)

* Use std::format and implement wallmaster

* Implement defense modifier

* Implement no_z and clean up

* Implement reverse controls

* Some fixes while testing CC connection

* Implement speed modifier and fix defese modifier

* Fail magic effects if magic is not acquired

* Fix queue system

* Implement rainstorm

* Some cleanup

* Use IS_ZERO to handle very low near zero values

* Split some effects

* Fix emptying magic

* Don’t run cucco on pre-rendered backgrounds

* Use correct method for updating ruppees

* Fix decreasing speed

* Remove old SDL stuff

* Remove old fixes

* Enable Crowd Control for both debug and release

* Add missing returns

* Cleanup event firing

* Further clean up on event firing

* Fix some bugs

* CC fixes and enemy spawning (#35)

* Fix icetraps

* Fix title screen

* Fix pause screen

* Fix death screen timer & Code cleanup

* Fix timer during textboxes

* Code cleanup

* Add: Multiple enemy spawning

* More enemies + more code cleanup (#36)

* Enums for returning effect states

* Add more enemies

* Update CrowdControl.cpp

* Remove enums from enemies

* Fix up flow for events (#37)

# Conflicts:
#	soh/soh/Enhancements/crowd-control/CrowdControl.cpp

* Fix spawn position of likelike

* CC temp enemy fixes (#38)

* Check for pause in pacifist and allow button presses (#39)

* Fix Pacifist mode (#41)

* First attempt pacifier fix

* Real fix for pacifist mode

* Comment

* Remove cutscene and long delay from cucco_storm (#40)

* Some PR Fixes

* Use standard types

* Handle JSON parsing error and free memory

* Add CC configuration file

* Add: Giving deku shield option. Fix: Giant Lonk (#42)

* Small stalfos fix (#43)

* Syntax Improvements (#44)

* Revert bools to uint32_t

* Add comment about bools

* Fix cucco storm, fix empty heart (#45)

* Protect commands vector with mutex

* prefix effects with chaosEffect (#46)

Co-authored-by: briaguya <briaguya@alice>

Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Co-authored-by: briaguya <briaguya@alice>
2022-09-27 22:41:17 -04:00

91 lines
3.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using CrowdControl.Common;
using CrowdControl.Games.Packs;
using ConnectorType = CrowdControl.Common.ConnectorType;
public class SoH : SimpleTCPPack
{
public override string Host { get; } = "127.0.0.1";
public override ushort Port { get; } = 43384;
public SoH(IPlayer player, Func<CrowdControlBlock, bool> responseHandler, Action<object> statusUpdateHandler) : base(player, responseHandler, statusUpdateHandler) { }
public override Game Game { get; } = new Game(90, "Ship of Harkinian", "SoH", "PC", ConnectorType.SimpleTCPConnector);
private Dictionary<string, string> _enemyType = new Dictionary<string, string>()
{
{"wallmaster", ("Wallmaster")},
{"arwing", ("Arwing")},
{"darklink", ("Dark Link")},
{"stalfos", ("Stalfos")},
{"wolfos", ("Wolfos")},
{"freezard", ("Freezard")},
{"keese", ("Keese")},
{"icekeese", ("Ice Keese")},
{"firekeese", ("Fire Keese")},
{"tektite", ("Tektite")},
{"likelike", ("Like-Like")}
};
public override List<Effect> Effects
{
get
{
List<Effect> effects = new List<Effect>
{
new Effect("Add Heart Container", "add_heart_container"),
new Effect("Remove Heart Container", "remove_heart_container"),
new Effect("Damage Multiplier", "damage_multiplier", new[] { "damdefmulti" }) { Duration = 30 },
new Effect("Defense Multiplier", "defense_multiplier", new[] { "damdefmulti" }) { Duration = 30 },
new Effect("Freeze Link", "freeze"),
new Effect("Giant Lonk", "giant_link") { Duration = 30 },
new Effect("Empty Heart", "damage", new[] { "health20" }),
new Effect("Fill Heart", "heal", new[] { "health20" }),
new Effect("Kill Player", "kill"),
new Effect("High Gravity", "high_gravity") { Duration = 30 },
new Effect("Hover Boots", "hover_boots") { Duration = 30 },
new Effect("Invisible Link", "invisible") { Duration = 30 },
new Effect("No UI", "no_ui") { Duration = 60 },
new Effect("Low Gravity", "low_gravity") { Duration = 30 },
new Effect("Fill Magic", "fill_magic"),
new Effect("Empty Magic", "empty_magic"),
new Effect("Minish Link", "minish_link") { Duration = 30 },
new Effect("No Z Button", "no_z") { Duration = 30 },
new Effect("One-Hit KO", "ohko") { Duration = 30 },
new Effect("Pacifist", "pacifist") { Duration = 15 },
new Effect("Paper Link", "paper_link") { Duration = 30 },
new Effect("Rainstorm", "rainstorm") { Duration = 30 },
new Effect("Reverse Controls", "reverse") { Duration = 60 },
new Effect("Give Rupees", "add_rupees", new[] { "rupees999" }),
new Effect("Take Rupees", "remove_rupees", new[] { "rupees999" }),
new Effect("Increase Speed", "increase_speed") { Duration = 30 },
new Effect("Decrease Speed", "decrease_speed") { Duration = 30 },
new Effect("Cucco Swarm", "cucco_storm"),
new Effect("Knockback Link", "knockback", new[] { "knockbackstrength" }),
new Effect("Burn Link", "burn"),
new Effect("Electrocute Link", "electrocute"),
new Effect("Iron Boots", "iron_boots") { Duration = 30 },
new Effect("Give Deku Shield", "give_dekushield"),
new Effect("Spawn Enemy", "spawn_enemy", ItemKind.Folder),
};
effects.AddRange(_enemyType.Select(t => new Effect($"Spawn {t.Value}", $"spawn_{t.Key}", "spawn_enemy")));
return effects;
}
}
//Slider ranges need to be defined
public override List<ItemType> ItemTypes => new List<ItemType>
{
new ItemType("Rupees", "rupees999", ItemType.Subtype.Slider, "{\"min\":1,\"max\":999}"),
new ItemType("Health", "health20", ItemType.Subtype.Slider, "{\"min\":1,\"max\":20}"),
new ItemType("Damage/Defense Multiplier", "damdefmulti", ItemType.Subtype.Slider, "{\"min\":1,\"max\":10}"),
new ItemType("Knockback Strength", "knockbackstrength", ItemType.Subtype.Slider, "{\"min\":1,\"max\":3}")
};
}