Karate Man Events have been merged also I forgot the toggle in the last update lol

This commit is contained in:
Carson Kompon
2022-03-01 12:40:59 -05:00
parent 3f84054779
commit 4142c09a4c
4 changed files with 491 additions and 18 deletions

View File

@ -36,6 +36,12 @@ namespace RhythmHeavenMania.Games.KarateMan
Custom
}
public enum BackgroundFXType
{
None,
Sunburst
}
public enum ShadowType
{
Tinted,
@ -64,6 +70,7 @@ namespace RhythmHeavenMania.Games.KarateMan
public SpriteRenderer BGFXSprite;
public BackgroundType BGType = BackgroundType.Yellow;
public BackgroundFXType BGFXType = BackgroundFXType.None;
public Color BGColor;
public ShadowType Shadow = ShadowType.Tinted;
@ -269,14 +276,18 @@ namespace RhythmHeavenMania.Games.KarateMan
}
}
public void BGFXOn()
public void SetBackgroundFX(BackgroundFXType type)
{
BGFXSprite.enabled = true;
}
public void BGFXOff()
{
BGFXSprite.enabled = false;
BGFXType = type;
if(BGFXType == BackgroundFXType.None)
{
BGFXSprite.enabled = false;
}
else
{
BGFXSprite.enabled = true;
}
}
public void SetBackgroundColor(int type, int shadowType, Color backgroundColor, Color shadowColor)

View File

@ -102,18 +102,23 @@ namespace RhythmHeavenMania.Editor
else if (objType.IsEnum)
{
List<TMP_Dropdown.OptionData> dropDownData = new List<TMP_Dropdown.OptionData>();
for (int i = 0; i < System.Enum.GetValues(objType).Length; i++)
var vals = Enum.GetValues(objType);
var selected = 0;
for (int i = 0; i < vals.Length; i++)
{
string name = System.Enum.GetNames(objType)[i];
string name = Enum.GetNames(objType)[i];
TMP_Dropdown.OptionData optionData = new TMP_Dropdown.OptionData();
optionData.text = name;
dropDownData.Add(optionData);
if ((int)vals.GetValue(i) == (int)parameterManager.entity[propertyName])
selected = i;
}
dropdown.AddOptions(dropDownData);
dropdown.value = Array.IndexOf(Enum.GetValues(objType), Enum.GetValues(objType).GetValue((int)parameterManager.entity[propertyName]));
dropdown.value = selected;
dropdown.onValueChanged.AddListener(delegate
{
parameterManager.entity[propertyName] = (int)Enum.GetValues(objType).GetValue(dropdown.value);

View File

@ -267,11 +267,18 @@ namespace RhythmHeavenMania
}),
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 4); }, 4.5f),
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentEntity.beat); }, 4f),
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentEntity.beat); }),
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }),
new GameAction("hit3", delegate
{
var e = eventCaller.currentEntity;
if(e.toggle)
KarateMan.instance.Hit4(e.beat);
else
KarateMan.instance.Hit3(e.beat);
}, 1f, false, new List<Param>()
{
new Param("toggle", false, "Hit 4")
}),
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true),
new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ),
new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }),
new GameAction("set background color", delegate {
var e = eventCaller.currentEntity;
var c = KarateMan.instance.BackgroundColors[e.type];
@ -282,13 +289,25 @@ namespace RhythmHeavenMania
new Param("type", KarateMan.BackgroundType.Yellow, "Background Type"),
new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type"),
new Param("colorA", new Color(), "Custom Background Color"),
new Param("colorB", new Color(), "Custom Shadow Color")
new Param("colorB", new Color(), "Custom Shadow Color"),
}),
new GameAction("set background fx", delegate {
KarateMan.instance.SetBackgroundFX((KarateMan.BackgroundFXType)eventCaller.currentEntity.type);
}, 0.5f, false, new List<Param>()
{
new Param("type", KarateMan.BackgroundFXType.None, "FX Type")
}),
// These are still here for backwards-compatibility but are hidden in the editor
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2, hidden: true),
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2, hidden: true),
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2, hidden: true),
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2, hidden: true),
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }, hidden: true),
new GameAction("bgfxon", delegate { KarateMan.instance.SetBackgroundFX(KarateMan.BackgroundFXType.Sunburst); }, hidden: true),
new GameAction("bgfxoff", delegate { KarateMan.instance.SetBackgroundFX(KarateMan.BackgroundFXType.None); }, hidden: true),
}),
new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, false, new List<GameAction>()
{