mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 05:47:40 +02:00
kman uses anim layers now
add animation repathing utility tweak animation speed for some kman animations add jump combo
This commit is contained in:
@ -16,6 +16,23 @@ namespace HeavenStudio.Games.Loaders
|
||||
{
|
||||
public static Minigame AddGame(EventCaller eventCaller)
|
||||
{
|
||||
RiqEntity GameModsUpdater(string datamodel, RiqEntity e)
|
||||
{
|
||||
if (datamodel == "karateman/set gameplay modifiers" && e.version < 1)
|
||||
{
|
||||
if (e["toggle"] == null) return null;
|
||||
|
||||
bool comboEnable = (bool)e["toggle"];
|
||||
e.CreateProperty("combo", (int)(comboEnable ? KarateMan.ComboMode.Normal : KarateMan.ComboMode.Disabled));
|
||||
e.dynamicData.Remove("toggle");
|
||||
e.version = 1;
|
||||
|
||||
return e;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
RiqBeatmap.OnUpdateEntity += GameModsUpdater;
|
||||
|
||||
RiqEntity WarningUpdater(string datamodel, RiqEntity e)
|
||||
{
|
||||
if (datamodel == "karateman/hitX")
|
||||
@ -73,31 +90,6 @@ namespace HeavenStudio.Games.Loaders
|
||||
}
|
||||
RiqBeatmap.OnUpdateEntity += BackgroundUpdater;
|
||||
|
||||
// RiqEntity GameCapitalizer(string datamodel, RiqEntity entity)
|
||||
// {
|
||||
// if (datamodel.Split('/')[0] == "karateman")
|
||||
// {
|
||||
// string name = datamodel.Split('/')[1];
|
||||
// entity.datamodel = "karateman/" + name;
|
||||
// var tempData = entity.dynamicData.ToDictionary(x => x.Key);
|
||||
// foreach ((string key, dynamic item) in tempData)
|
||||
// {
|
||||
// if (item.GetType() == typeof(Newtonsoft.Json.Linq.JObject)) {
|
||||
// entity.dynamicData[key] = new Color((float)item["r"], (float)item["g"], (float)item["b"]);
|
||||
// }
|
||||
// Debug.Log(key + ", " + item);
|
||||
// }
|
||||
// entity.version = 1;
|
||||
|
||||
// return entity;
|
||||
// } else if (datamodel == "gameManager/switchGame/karateman") {
|
||||
// entity.datamodel = "gameManager/switchGame/karateman";
|
||||
// return entity;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
// RiqBeatmap.OnUpdateEntity += GameCapitalizer;
|
||||
|
||||
return new Minigame("karateman", "Karate Man", "fbca3e", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("bop", "Bop")
|
||||
@ -253,17 +245,17 @@ namespace HeavenStudio.Games.Loaders
|
||||
{
|
||||
function = delegate {
|
||||
var e = eventCaller.currentEntity;
|
||||
KarateMan.instance.SetGameplayMods(e.beat, e["fxType"], e["type"], e["toggle"]);
|
||||
KarateMan.instance.SetGameplayMods(e.beat, e["fxType"], e["type"], e["combo"]);
|
||||
},
|
||||
defaultLength = 0.5f,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("fxType", KarateMan.BackgroundFXType.None, "FX Type", "Set the background effect to be displayed."),
|
||||
new Param("type", KarateMan.NoriMode.None, "Flow Bar", "Set the type of Flow bar to use."),
|
||||
// new Param("hitsPerHeart", new EntityTypes.Float(0f, 20f, 0f), "Hits Per Heart", "How many hits it will take for each heart to light up (0 will do it automatically.)"),
|
||||
new Param("toggle", true, "Enable Combos", "Toggle if Karate Joe will be able to perform combos. This will not affect Touch Style controls."),
|
||||
new Param("combo", KarateMan.ComboMode.Normal, "Enable Combos", "Toggle if Karate Joe will be able to perform combos, and the type of combo used."),
|
||||
// new Param("toggle2", true, "Enable Kicks", "Allow the player to kick? (Contextual kicks will still be allowed even when off)"),
|
||||
},
|
||||
defaultVersion = 1,
|
||||
},
|
||||
new GameAction("background appearance", "Background Appearance")
|
||||
{
|
||||
@ -308,28 +300,6 @@ namespace HeavenStudio.Games.Loaders
|
||||
new Param("endTexture", new Color(), "End Texture Color", "Set the color at the end of the event."),
|
||||
},
|
||||
},
|
||||
// new GameAction("set background effects", "Background Appearance (OLD)")
|
||||
// {
|
||||
// function = delegate {
|
||||
// var e = eventCaller.currentEntity;
|
||||
// KarateMan.instance.SetBgAndShadowCol(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], e["type3"]);
|
||||
// KarateMan.instance.SetBgFx(e["type4"], e["type5"], e["colorC"], e["colorD"]);
|
||||
// },
|
||||
// defaultLength = 0.5f,
|
||||
// resizable = true,
|
||||
// parameters = new List<Param>()
|
||||
// {
|
||||
// new Param("type", KarateMan.BackgroundType.Yellow, "Background Type", "The preset background type"),
|
||||
// new Param("type2", KarateMan.ShadowType.Tinted, "Shadow Type", "The shadow type. If Tinted doesn't work with your background color try Custom"),
|
||||
// new Param("colorA", new Color(), "Custom Background Color", "The background color to use when background type is set to Custom"),
|
||||
// new Param("colorB", new Color(), "Custom Shadow Color", "The shadow color to use when shadow type is set to Custom. When fading the background colour shadows fade to this color"),
|
||||
// new Param("type3", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed. Fade uses the entity length to determine colour fading speed"),
|
||||
// new Param("type4", KarateMan.BackgroundTextureType.Plain, "Texture", "The type of background texture to use"),
|
||||
// new Param("type5", KarateMan.ShadowType.Tinted, "Color Filter Type", "The method used to apply colour to the texture"),
|
||||
// new Param("colorC", new Color(), "Custom Filter Color", "The filter color to use when color filter type is set to Custom"),
|
||||
// new Param("colorD", new Color(), "Fading Filter Color", "When using the Fade background effect, make filter colour fade to this colour"),
|
||||
// },
|
||||
// },
|
||||
new GameAction("set object colors", "Object Appearance")
|
||||
{
|
||||
function = delegate {
|
||||
@ -521,11 +491,16 @@ namespace HeavenStudio.Games
|
||||
Mania,
|
||||
ManiaHorizontal,
|
||||
}
|
||||
|
||||
public enum ComboMode
|
||||
{
|
||||
Disabled,
|
||||
Normal,
|
||||
Jump,
|
||||
}
|
||||
#endregion
|
||||
|
||||
// static List<RiqEntity> queuedCues = new();
|
||||
public static bool IsComboEnable = true; //only stops Out combo inputs, this basically makes combo contextual
|
||||
// public static bool IsKickEnable = true; //same as above, except with kick inputs
|
||||
public static ComboMode IsComboEnable = ComboMode.Normal; //only stops Out combo inputs, this basically makes combo contextual
|
||||
public bool IsNoriActive { get { return Nori.MaxNori > 0; } }
|
||||
public float NoriPerformance { get { if (IsNoriActive) return Nori.Nori / Nori.MaxNori; else return 1f; } }
|
||||
|
||||
@ -1113,12 +1088,12 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
public void SetGameplayMods(double beat, int fxType, int mode, bool combo)
|
||||
public void SetGameplayMods(double beat, int fxType, int mode, int combo)
|
||||
{
|
||||
NoriGO.SetActive(true);
|
||||
Nori.SetNoriMode(beat, mode);
|
||||
currentBgEffect = fxType;
|
||||
IsComboEnable = combo;
|
||||
IsComboEnable = (ComboMode)combo;
|
||||
// IsKickEnable = kick;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
public class KarateManJoe : MonoBehaviour
|
||||
{
|
||||
public Animator anim;
|
||||
public Animator FaceAnim;
|
||||
public GameEvent bop = new GameEvent();
|
||||
public SpriteRenderer[] Shadows;
|
||||
|
||||
@ -158,7 +157,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
}
|
||||
}
|
||||
|
||||
if (PlayerInput.GetIsAction(KarateMan.InputAction_AltDown) && KarateMan.IsComboEnable && !inSpecial)
|
||||
if (PlayerInput.GetIsAction(KarateMan.InputAction_AltDown) && (KarateMan.IsComboEnable != KarateMan.ComboMode.Disabled) && !inSpecial)
|
||||
{
|
||||
if (!KarateMan.instance.IsExpectingInputNow(KarateMan.InputAction_AltDown))
|
||||
{
|
||||
@ -292,7 +291,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
comboWaiting = true;
|
||||
break;
|
||||
case 3:
|
||||
anim.DoScaledAnimationAsync("UpperCut", 0.5f);
|
||||
anim.DoScaledAnimationAsync(KarateMan.IsComboEnable == KarateMan.ComboMode.Jump ? "UpperCutJump" : "UpperCut", 0.5f);
|
||||
lockedInCombo = false;
|
||||
comboWaiting = false;
|
||||
break;
|
||||
@ -412,14 +411,14 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
|
||||
public void SetFaceExpressionForced(int face)
|
||||
{
|
||||
FaceAnim.DoScaledAnimationAsync("Face" + face.ToString("D2"));
|
||||
anim.DoScaledAnimationAsync("Head.Face" + face.ToString("D2"));
|
||||
}
|
||||
|
||||
public void SetFaceExpression(int face, bool ignoreCheck = false)
|
||||
{
|
||||
wantFace = face;
|
||||
if (canEmote || ignoreCheck)
|
||||
FaceAnim.DoScaledAnimationAsync("Face" + face.ToString("D2"));
|
||||
anim.DoScaledAnimationAsync("Head.Face" + face.ToString("D2"));
|
||||
}
|
||||
|
||||
public void ApplyBombGlow()
|
||||
|
@ -809,7 +809,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
|
||||
public void ItemWrongAction(PlayerActionEvent caller, float state)
|
||||
{
|
||||
if (GameManager.instance.currentGame != "karateman") return;
|
||||
if (!KarateMan.IsComboEnable) return;
|
||||
if (KarateMan.IsComboEnable == KarateMan.ComboMode.Disabled) return;
|
||||
//hitting a normal object with the alt input
|
||||
//WHEN SCORING THIS IS A MISS
|
||||
var joe = KarateMan.instance.Joe;
|
||||
|
@ -806,6 +806,7 @@ namespace HeavenStudio.Editor.Track
|
||||
if (entity == null)
|
||||
{
|
||||
RiqEntity en = GameManager.instance.Beatmap.AddNewEntity(eventName, 0, action.defaultLength);
|
||||
en.version = action.defaultVersion;
|
||||
|
||||
tempEntity = en;
|
||||
|
||||
|
@ -662,6 +662,7 @@ namespace HeavenStudio
|
||||
public string tabName;
|
||||
public EventCallback function = delegate { };
|
||||
public float defaultLength = 1;
|
||||
public int defaultVersion = 0;
|
||||
public bool resizable = false;
|
||||
public List<Param> parameters = null;
|
||||
public bool hidden = false;
|
||||
@ -685,7 +686,7 @@ namespace HeavenStudio
|
||||
/// <param name="preFunction">What the block does when the GameManager seeks to this cue for pre-scheduling.</param>
|
||||
/// <param name="hidden">Prevents the block from being shown in the game list. Block will still function normally if it is in the timeline.</param>
|
||||
/// <param name="priority">Priority of this event. Higher priority events will be run first.</param>
|
||||
public GameAction(string actionName, string displayName, string tabName, float defaultLength = 1, bool resizable = false, List<Param> parameters = null, EventCallback function = null, EventCallback inactiveFunction = null, EventCallback preFunction = null, bool hidden = false, int priority = 0, float preFunctionLength = 2.0f)
|
||||
public GameAction(string actionName, string displayName, string tabName, float defaultLength = 1, bool resizable = false, List<Param> parameters = null, EventCallback function = null, EventCallback inactiveFunction = null, EventCallback preFunction = null, bool hidden = false, int priority = 0, float preFunctionLength = 2.0f, int defaultVersion = 0)
|
||||
{
|
||||
this.actionName = actionName;
|
||||
this.displayName = string.IsNullOrEmpty(displayName) ? actionName : displayName;
|
||||
@ -701,6 +702,7 @@ namespace HeavenStudio
|
||||
this.preFunction = preFunction ?? delegate { };
|
||||
this.priority = priority;
|
||||
this.preFunctionLength = preFunctionLength;
|
||||
this.defaultVersion = defaultVersion;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user