Custom Shakes (init)

idk about the rest, some bug fixes and some tweaks
This commit is contained in:
Mytiaoga 2024-02-13 12:55:33 +08:00
parent 46db1f83c5
commit 2b4850104a
8 changed files with 1702 additions and 93 deletions

File diff suppressed because one or more lines are too long

View file

@ -615,10 +615,13 @@ MonoBehaviour:
scheduledInputs: [] scheduledInputs: []
labGuy: {fileID: 2166375559639248018} labGuy: {fileID: 2166375559639248018}
labGuyHead: {fileID: 2213739574016045658} labGuyHead: {fileID: 2213739574016045658}
labGuyArm: {fileID: 6425664033193447254}
labGirl: {fileID: 2679407609467283902} labGirl: {fileID: 2679407609467283902}
labGirlHead: {fileID: 3393587621863104861} labGirlHead: {fileID: 3393587621863104861}
labGirlArm: {fileID: 2801754847648881029}
labAssistant: {fileID: 4557519451044364801} labAssistant: {fileID: 4557519451044364801}
labAssistantHead: {fileID: 7230862986891120656} labAssistantHead: {fileID: 7230862986891120656}
labAssistantArm: {fileID: 8475969050307686821}
flask: {fileID: 0} flask: {fileID: 0}
labFlaskObj: {fileID: 6033749656558512970, guid: 95f2093cb48221e4fa1961a03fdcffee, type: 3} labFlaskObj: {fileID: 6033749656558512970, guid: 95f2093cb48221e4fa1961a03fdcffee, type: 3}
labGirlFlaskObj: {fileID: 6033749656558512970, guid: 7509505865426904dbc2986ec719a8d7, type: 3} labGirlFlaskObj: {fileID: 6033749656558512970, guid: 7509505865426904dbc2986ec719a8d7, type: 3}
@ -639,14 +642,12 @@ MonoBehaviour:
spotlightCone: {fileID: 5070524962511805796} spotlightCone: {fileID: 5070524962511805796}
labHeartBox: {fileID: 2938495750069376480} labHeartBox: {fileID: 2938495750069376480}
boxPerson: {fileID: 7654582273108844636} boxPerson: {fileID: 7654582273108844636}
boxPersonDay: {fileID: 7488400320160201047}
heartContainer: {fileID: 2687961951367931963, guid: eba582805738b7444ab4244c59409871, type: 3} heartContainer: {fileID: 2687961951367931963, guid: eba582805738b7444ab4244c59409871, type: 3}
labGuyFlask: {fileID: 7024684491928204742}
labGirlFlask: {fileID: 344072480916160056}
girlInstantiatedFlask: [] girlInstantiatedFlask: []
weirdInstantiatedFlask: [] weirdInstantiatedFlask: []
labGuyArm: {fileID: 6425664033193447254}
labGuyFlask: {fileID: 7024684491928204742}
labGirlArm: {fileID: 2801754847648881029}
labGirlFlask: {fileID: 344072480916160056}
labAssistantArm: {fileID: 8475969050307686821}
hasMissed: 0 hasMissed: 0
bopRight: 0 bopRight: 0
isHoldingWhiff: 0 isHoldingWhiff: 0
@ -686,7 +687,7 @@ MonoBehaviour:
- key: rot - key: rot
value: 0 value: 0
- name: GirlFastFlaskIn - name: GirlFastFlaskIn
preview: 1 preview: 0
anchor: {fileID: 0} anchor: {fileID: 0}
positions: positions:
- tag: - tag:
@ -752,7 +753,7 @@ MonoBehaviour:
- key: rot - key: rot
value: 0 value: 0
- name: GirlFlaskMiss - name: GirlFlaskMiss
preview: 1 preview: 0
anchor: {fileID: 0} anchor: {fileID: 0}
positions: positions:
- tag: - tag:
@ -6748,8 +6749,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1206791551451555203} m_GameObject: {fileID: 1206791551451555203}
m_LocalRotation: {x: -0, y: -0, z: -0.6427876, w: 0.7660445} m_LocalRotation: {x: -0, y: -0, z: -0.6427876, w: 0.7660445}
m_LocalPosition: {x: 4, y: 1.94, z: 0} m_LocalPosition: {x: 24, y: 2, z: 0}
m_LocalScale: {x: 18.414345, y: 10.451385, z: 9.9537} m_LocalScale: {x: 50, y: 50, z: 0}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 930037580571553143} m_Father: {fileID: 930037580571553143}
@ -7298,8 +7299,8 @@ Transform:
m_GameObject: {fileID: 1612937315996693382} m_GameObject: {fileID: 1612937315996693382}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 18.414345, y: 10.451385, z: 9.9537} m_LocalScale: {x: 50, y: 50, z: 50}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 1
m_Children: [] m_Children: []
m_Father: {fileID: 4352296737110256235} m_Father: {fileID: 4352296737110256235}
m_RootOrder: 0 m_RootOrder: 0
@ -10112,8 +10113,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3976450293214606469} m_GameObject: {fileID: 3976450293214606469}
m_LocalRotation: {x: -0, y: -0, z: 0.6427876, w: 0.7660445} m_LocalRotation: {x: -0, y: -0, z: 0.6427876, w: 0.7660445}
m_LocalPosition: {x: -11, y: 1.94, z: 0} m_LocalPosition: {x: -31.5, y: 2, z: 0}
m_LocalScale: {x: 18.414345, y: 10.451385, z: 9.9537} m_LocalScale: {x: 50, y: 50, z: 0}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 930037580571553143} m_Father: {fileID: 930037580571553143}
@ -10243,7 +10244,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 2000 m_SortingOrder: 2001
m_Sprite: {fileID: -134353524, guid: 32b8969086bedeb45b1cb9a4a9c5cddb, type: 3} m_Sprite: {fileID: -134353524, guid: 32b8969086bedeb45b1cb9a4a9c5cddb, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
@ -12120,8 +12121,8 @@ Transform:
m_GameObject: {fileID: 5626236978170321824} m_GameObject: {fileID: 5626236978170321824}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 18.414345, y: 10.451385, z: 9.9537} m_LocalScale: {x: 50, y: 50, z: 50}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 1
m_Children: [] m_Children: []
m_Father: {fileID: 863251278291212039} m_Father: {fileID: 863251278291212039}
m_RootOrder: 0 m_RootOrder: 0

View file

@ -83,6 +83,6 @@ Material:
- _ZWrite: 1 - _ZWrite: 1
m_Colors: m_Colors:
- _AddColor: {r: 0, g: 0, b: 0, a: 1} - _AddColor: {r: 0, g: 0, b: 0, a: 1}
- _Color: {r: 0.9528302, g: 0.87130237, b: 0.7775454, a: 1} - _Color: {r: 0.9529412, g: 0.87058824, b: 0.7764706, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []

View file

@ -3268,6 +3268,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Cursor value: Cursor
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 285182280367868641, guid: 81ce52789acca4440804eb938de70425, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 285182280367868644, guid: 81ce52789acca4440804eb938de70425, type: 3} - target: {fileID: 285182280367868644, guid: 81ce52789acca4440804eb938de70425, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 9 value: 9
@ -14029,7 +14033,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 171581557} m_TargetGraphic: {fileID: 171581557}
m_HandleRect: {fileID: 171581556} m_HandleRect: {fileID: 171581556}
m_Direction: 2 m_Direction: 2
m_Value: 1 m_Value: 0
m_Size: 1 m_Size: 1
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
@ -18390,6 +18394,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: CamerasEditor value: CamerasEditor
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6052331674888157615, guid: 720073bc7682b1441bece7116681f72c, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6136050241491700490, guid: 720073bc7682b1441bece7116681f72c, type: 3} - target: {fileID: 6136050241491700490, guid: 720073bc7682b1441bece7116681f72c, type: 3}
propertyPath: m_RaycastTarget propertyPath: m_RaycastTarget
value: 0 value: 0
@ -26851,7 +26859,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1589389271} m_HandleRect: {fileID: 1589389271}
m_Direction: 2 m_Direction: 2
m_Value: 0 m_Value: 0
m_Size: 1 m_Size: 0.9995103
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
@ -32707,7 +32715,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 109.67346} m_AnchoredPosition: {x: 0, y: 108.85712}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 1} m_Pivot: {x: 0.5, y: 1}
--- !u!222 &1154875945 --- !u!222 &1154875945
@ -43456,7 +43464,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1220118244} m_HandleRect: {fileID: 1220118244}
m_Direction: 2 m_Direction: 2
m_Value: 1.0000004 m_Value: 1.0000004
m_Size: 0.5104374 m_Size: 0.50367343
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:

View file

@ -1,8 +1,8 @@
using System; using System;
public static class AppInfo { public static class AppInfo {
public const string Version = "1.0.2"; public const string Version = "1.0.9";
public static readonly DateTime Date = new DateTime(2024, 02, 11, 01, 27, 27, 764, DateTimeKind.Utc); public static readonly DateTime Date = new DateTime(2024, 02, 13, 04, 48, 05, 124, DateTimeKind.Utc);
} }

View file

@ -50,6 +50,7 @@ namespace HeavenStudio.Games.Loaders
new Param("colorB", new Color(0.81f, 0.2984211f, 0f), "2nd Flask Color", "2nd Flask Color to show"), new Param("colorB", new Color(0.81f, 0.2984211f, 0f), "2nd Flask Color", "2nd Flask Color to show"),
new Param("colorC", new Color(0.8313726f, 0.2039216f, 0.5058824f), "3rd Flask Color", "3rd Flask Color to show") new Param("colorC", new Color(0.8313726f, 0.2039216f, 0.5058824f), "3rd Flask Color", "3rd Flask Color to show")
}, },
priority = 2
}, },
new GameAction("set time of day", "Time of Day") new GameAction("set time of day", "Time of Day")
@ -74,7 +75,30 @@ namespace HeavenStudio.Games.Loaders
new Param("toggle", false, "Spotlight", "Activate Spotlight?"), new Param("toggle", false, "Spotlight", "Activate Spotlight?"),
new Param("spotType", LoveLab.spotlightType.normal, "Spotlight Type", "Normal or Coned?"), new Param("spotType", LoveLab.spotlightType.normal, "Spotlight Type", "Normal or Coned?"),
new Param("posType", LoveLab.spotlightPos.boy, "Spotlight Position", "(For cone) under the Boy or the Girl?") new Param("posType", LoveLab.spotlightPos.boy, "Spotlight Position", "(For cone) under the Boy or the Girl?")
} },
priority = 1
},
new GameAction("beat intervals", "Start Interval")
{
function = delegate { LoveLab.PreInterval(e.currentEntity.beat, e.currentEntity.length, e.currentEntity["auto"]); },
parameters = new List<Param>()
{
new Param("auto", true, "Auto Pass Turn", "Toggle if the turn should be passed automatically at the end of the start interval.")
},
defaultLength = 4f,
resizable = true,
priority = 2,
},
new GameAction("boy shakes", "Boy Shakes")
{
parameters = new List<Param>()
{
new Param("speed", LoveLab.throwFlaskSpeedType.fastFlask, "Flask Speed", "How fast should the boy throw the flasks to the girl?")
},
defaultLength = .5f,
resizable = true,
priority = 1
}, },
new GameAction("1Heart", "1 Heart") new GameAction("1Heart", "1 Heart")
@ -132,14 +156,17 @@ namespace HeavenStudio.Games
[Header("Lab Guy")] [Header("Lab Guy")]
[SerializeField] private GameObject labGuy; [SerializeField] private GameObject labGuy;
public Animator labGuyHead; public Animator labGuyHead;
public GameObject labGuyArm;
[Header("Lab Girl")] [Header("Lab Girl")]
[SerializeField] private GameObject labGirl; [SerializeField] private GameObject labGirl;
public Animator labGirlHead; public Animator labGirlHead;
public GameObject labGirlArm;
[Header("Lab Weird")] [Header("Lab Weird")]
[SerializeField] private GameObject labAssistant; [SerializeField] private GameObject labAssistant;
[SerializeField] private Animator labAssistantHead; [SerializeField] private Animator labAssistantHead;
public GameObject labAssistantArm;
[Header("Flask")] [Header("Flask")]
public GameObject flask; public GameObject flask;
@ -167,20 +194,15 @@ namespace HeavenStudio.Games
[SerializeField] GameObject spotlightCone; [SerializeField] GameObject spotlightCone;
[SerializeField] private GameObject labHeartBox; [SerializeField] private GameObject labHeartBox;
[SerializeField] private Animator boxPerson; [SerializeField] private Animator boxPerson;
[SerializeField] private Animator boxPersonDay;
[SerializeField] private GameObject heartContainer; [SerializeField] private GameObject heartContainer;
[SerializeField] GameObject labGuyFlask;
[SerializeField] GameObject labGirlFlask;
public static List<QueuedFlask> queuedFlask = new List<QueuedFlask>(); public static List<QueuedFlask> queuedFlask = new List<QueuedFlask>();
//public List<GameObject> boyInstantiatedFlask = new List<GameObject>(); //blank to boy //public List<GameObject> boyInstantiatedFlask = new List<GameObject>(); //blank to boy
public List<LoveLabForGirlFlask> girlInstantiatedFlask = new List<LoveLabForGirlFlask>(); //boy to girl public List<LoveLabForGirlFlask> girlInstantiatedFlask = new List<LoveLabForGirlFlask>(); //boy to girl
public List<LoveLabForGirlFlask> weirdInstantiatedFlask = new List<LoveLabForGirlFlask>(); //girl to weird public List<LoveLabForGirlFlask> weirdInstantiatedFlask = new List<LoveLabForGirlFlask>(); //girl to weird
[Header("Arms")]
public GameObject labGuyArm;
[SerializeField] GameObject labGuyFlask;
public GameObject labGirlArm;
[SerializeField] GameObject labGirlFlask;
public GameObject labAssistantArm;
[Header("Variables")] [Header("Variables")]
public bool hasMissed = false; public bool hasMissed = false;
private bool canBop = false; private bool canBop = false;
@ -189,7 +211,11 @@ namespace HeavenStudio.Games
bool isHoldingWhiffAlt = false; bool isHoldingWhiffAlt = false;
bool isHoldingWhiffPressed = false; bool isHoldingWhiffPressed = false;
public bool canCallForFlask = true; public bool canCallForFlask = true;
bool isDay = false;
bool hasStartedInterval;
bool isHolding;
int counter;
[Header("Clouds")] [Header("Clouds")]
[SerializeField] GameObject clouds; [SerializeField] GameObject clouds;
@ -206,6 +232,9 @@ namespace HeavenStudio.Games
[SerializeField] Material weirdShader; [SerializeField] Material weirdShader;
[SerializeField] GameObject weirdHeaderShader; [SerializeField] GameObject weirdHeaderShader;
//[Header("Hearts")]
//public List<Sprite> warningSprites = new List<Sprite>();
#region time of day #region time of day
public enum timeOfDay public enum timeOfDay
@ -239,6 +268,8 @@ namespace HeavenStudio.Games
weirdShader.SetColor("_ColorDelta", new Color(0.8941177f, 0.1882353f, 0f)); // E43000 weirdShader.SetColor("_ColorDelta", new Color(0.8941177f, 0.1882353f, 0f)); // E43000
weirdHeaderShader.SetActive(true); weirdHeaderShader.SetActive(true);
isDay = false;
} }
public void setTimeOfDay(int tod) public void setTimeOfDay(int tod)
@ -269,13 +300,293 @@ namespace HeavenStudio.Games
weirdShader.SetColor("_ColorDelta", new Color(0.9686275f, 0.3803922f, 0.03137255f)); // F76108 weirdShader.SetColor("_ColorDelta", new Color(0.9686275f, 0.3803922f, 0.03137255f)); // F76108
weirdHeaderShader.SetActive(false); weirdHeaderShader.SetActive(false);
isDay = true;
} }
} }
#endregion #endregion
//normal spotlight when someone grabs on it -> 5f the distance #region intervals
public enum throwFlaskSpeedType
{
fastFlask,
slowFlask,
midSlowFlask
}
private struct queuedInterval
{
public double beat;
public float interval;
public bool autoPassTurn;
}
private static List<queuedInterval> queuedIntervals = new List<queuedInterval>();
public static void PreInterval(double beat, float interval, bool autoPassTurn)
{
if (GameManager.instance.currentGame == "loveLab")
{
instance.SetIntervalStart(beat, interval, beat, autoPassTurn);
}
else
{
queuedIntervals.Add(new queuedInterval
{
beat = beat,
interval = interval,
autoPassTurn = autoPassTurn
});
}
}
private void SetIntervalStart(double beat, float interval, double gameSwitchBeat, bool autoPassTurn)
{
List<RiqEntity> reqShakeEvents = GetAllSpeaksInBetweenBeat(beat, beat + interval);
reqShakeEvents.Sort((x, y) => x.beat.CompareTo(y.beat));
List<BeatAction.Action> queuedFlasks = new()
{
new BeatAction.Action(beat, delegate
{
//initial shakes
if (autoPassTurn)
{
//pass to girl
BoyPassToGirl(beat + interval, beat, beat + interval, 1, reqShakeEvents.Count);
}
})
};
for (int i = 0; i < reqShakeEvents.Count; i++)
{
RiqEntity shakeEventToCheck = reqShakeEvents[i];
if (shakeEventToCheck.beat >= gameSwitchBeat)
{
queuedFlasks.Add(new BeatAction.Action(shakeEventToCheck.beat, delegate
{
//lab boy shake
boyShake(shakeEventToCheck.beat, shakeEventToCheck.length, beat, beat + interval, shakeEventToCheck["speed"]);
}));
}
}
BeatAction.New(this, queuedFlasks);
}
private List<RiqEntity> GetAllSpeaksInBetweenBeat(double beat, double endBeat)
{
List<RiqEntity> speakEvents = EventCaller.GetAllInGameManagerList("loveLab", new string[] { "boy shakes" });
List<RiqEntity> tempEvents = new();
foreach (var entity in speakEvents)
{
if (entity.beat >= beat && entity.beat < endBeat)
{
tempEvents.Add(entity);
}
}
return tempEvents;
}
private void boyShake(double beat, double length, double firstBeatOfInterval, double lastBeatOfInterval, int speedType)
{
//debug stuff
//Debug.LogWarning("Beat: " + beat);
//Debug.LogWarning("Length: " + (beat + length));
//Debug.LogWarning("First Beat: " + firstBeatOfInterval);
//Debug.LogWarning("Last Beat: " + lastBeatOfInterval);
//Debug.LogWarning("Speed Type: " + speedType);
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate {
labGuyHead.DoScaledAnimationAsync("GuyRightFace");
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + .5f, delegate
{
labGirlHead.Play("GirlLeftFace");
})
});
if (!hasStartedInterval)
{
SoundByte.PlayOneShotGame("loveLab/LeftCatch", beat, forcePlay: true);
labGuyArm.GetComponent<Animator>().Play("GrabFlask");
hasStartedInterval = true;
spawnCustomFlask(beat);
}
else if(beat > firstBeatOfInterval)
{
SoundByte.PlayOneShotGame("loveLab/shakeDown");
labGuyArm.GetComponent<Animator>().Play("ShakeFlaskDown");
}
}),
new BeatAction.Action(beat + length, delegate {
if(lastBeatOfInterval > beat + length)
{
SoundByte.PlayOneShotGame("loveLab/shakeUp");
labGuyArm.GetComponent<Animator>().Play("ShakeFlaskUp");
}
else
{
SoundByte.PlayOneShotGame("loveLab/leftThrow");
labGuyArm.GetComponent<Animator>().Play("ThrowFlask");
spawnFlaskForGirlCustom((beat + length) + 1f, speedType);
}
}),
});
}
private void BoyPassToGirl(double beat, double intervalBeat, double endBeat, float length, int counter)
{
var inputs = GetAllSpeaksInBetweenBeat(intervalBeat, endBeat);
inputs.Sort((x, y) => x.beat.CompareTo(y.beat));
this.counter = counter;
for (int i = 0; i < inputs.Count; i++)
{
var input = inputs[i];
double relativeBeat = input.beat - intervalBeat;
double testBeat = (input.beat + input.length) - intervalBeat;
if(i == 0)
{
inputs[0]["speed"] = inputs[inputs.Count - 1]["speed"];
if(inputs[i]["speed"] == 0)
{
ScheduleInput(beat, length + relativeBeat, InputAction_Nrm, onCatch, onMiss, onEmpty);
}
else
{
ScheduleInput(beat, (length + relativeBeat) + 1f, InputAction_Nrm, onCatch, onMiss, onEmpty);
}
}
else
{
ScheduleInput(beat, length + relativeBeat, InputAction_Nrm, onCatch, onMiss, onEmpty);
}
if ((inputs[i].beat + inputs[i].length) == endBeat)
{
ScheduleInput(beat, (length + testBeat), InputAction_DPad, onRelease, onMiss, onEmpty);
}
else
{
ScheduleAutoplayInput(beat, (length + testBeat), InputAction_DPad, onUpAuto, onMiss, onEmpty);
}
}
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate
{
hasMissed = false;
}),
new BeatAction.Action(endBeat + 1f, delegate
{
labGuyHead.Play("GuyFaceIdle");
if (labGuyArm.GetComponent<Animator>().IsAnimationNotPlaying())
{
labGuyArm.GetComponent<Animator>().Play("ArmIdle");
}
})
});
}
public static void onCatch(PlayerActionEvent caller, float beat)
{
instance.labGirlHead.Play("GirlIdleFace");
if (!instance.isHolding)
{
instance.isHolding = true;
SoundByte.PlayOneShotGame("loveLab/RightCatch");
instance.labGirlArm.GetComponent<Animator>().DoScaledAnimationAsync("GrabFlask");
LoveLab.instance.girlInstantiatedFlask[0].GetComponent<LoveLabForGirlFlask>().destroyThisObj();
}
else if(instance.counter > 1 && instance.isHolding)
{
SoundByte.PlayOneShotGame("loveLab/shakeDown");
instance.labGirlArm.GetComponent<Animator>().DoScaledAnimationAsync("ShakeFlaskDown");
}
}
public static void onUpAuto(PlayerActionEvent caller, float beat)
{
SoundByte.PlayOneShotGame("loveLab/shakeUp");
instance.labGirlArm.GetComponent<Animator>().DoScaledAnimationAsync("ShakeFlaskUp");
}
public static void onRelease(PlayerActionEvent caller, float beat)
{
instance.labGirlHead.DoScaledAnimationAsync("GirlIdleFace");
SoundByte.PlayOneShotGame("loveLab/rightThrowNoShake");
instance.labGirlArm.GetComponent<Animator>().DoScaledAnimationAsync("ThrowFlask");
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action((caller.startBeat + caller.timer) + 1f, delegate
{
instance.labGirlHead.Play("GirlIdleFace");
if (instance.labGirlArm.GetComponent<Animator>().IsAnimationNotPlaying())
{
instance.labGirlArm.GetComponent<Animator>().Play("ArmIdle");
}
})
});
}
public void onDownFlaskCustom()
{
SoundByte.PlayOneShotGame("loveLab/shakeDown");
labGirlArm.GetComponent<Animator>().DoScaledAnimationAsync("ShakeFlaskDown");
}
public void spawnFlaskForGirlCustom(double beat, int flaskHeart) //boy to girl
{
//flaskMatForBoy.SetColor("_ColorAlpha", instance.boyLiquidColor);
LoveLabForGirlFlask spawnedFlask = Instantiate(labFlaskObj, instance.transform).AddComponent<LoveLabForGirlFlask>();
switch (flaskHeart)
{
case 0:
spawnedFlask.FastInit(beat);
break;
case 1:
spawnedFlask.SlowInit(beat);
break;
case 2:
spawnedFlask.MidSlowInit(beat);
break;
}
girlInstantiatedFlask.Add(spawnedFlask.GetComponent<LoveLabForGirlFlask>());
}
public void spawnCustomFlask(double beat) //wall to boy
{
LoveLabFlask spawnedFlask = Instantiate(labFlaskObj, instance.transform).AddComponent<LoveLabFlask>();
spawnedFlask.customShakes(beat);
}
#endregion
//make a smooth transition to day to sunset and vice versa //make a smooth transition to day to sunset and vice versa
/*
* would be nice if there were visual warnings for the next game
* head of dj and student for the hearts
* balls of munchy monk
* fruits for catchy tune
* balls for double date
* pots for karate man
* shuttlecock for air rally
* farmer head for second contact
* etc.
*
*/
/* /*
* lovelabflask script * lovelabflask script
* ask for how many flask * ask for how many flask
@ -306,18 +617,6 @@ namespace HeavenStudio.Games
[SerializeField] SuperCurveObject.Path[] flaskBouncePath; [SerializeField] SuperCurveObject.Path[] flaskBouncePath;
//public void spotlight(bool active)
//{
// if(active == true)
// {
// spotlightShader.SetActive(true);
// }
// else
// {
// spotlightShader.SetActive(false);
// }
//}
public void spotlight(bool active, int whichType, int whichPos) public void spotlight(bool active, int whichType, int whichPos)
{ {
if(active == true) if(active == true)
@ -386,29 +685,29 @@ namespace HeavenStudio.Games
private void OnDestroy() private void OnDestroy()
{ {
preChecks(0f); //preChecks(0f);
queuedFlask.Clear(); queuedFlask.Clear();
destroyAllFlasks(); //destroyAllFlasks();
foreach (var evt in scheduledInputs) foreach (var evt in scheduledInputs)
{ {
evt.Disable(); evt.Disable();
} }
} }
private void destroyAllFlasks() //private void destroyAllFlasks()
{ //{
foreach(LoveLabForGirlFlask girl in girlInstantiatedFlask) // foreach(LoveLabForGirlFlask girl in girlInstantiatedFlask)
{ // {
Destroy(girl); // Destroy(girl);
} // }
girlInstantiatedFlask.Clear(); // girlInstantiatedFlask.Clear();
foreach (LoveLabForGirlFlask weird in weirdInstantiatedFlask) // foreach (LoveLabForGirlFlask weird in weirdInstantiatedFlask)
{ // {
Destroy(weird); // Destroy(weird);
} // }
weirdInstantiatedFlask.Clear(); // weirdInstantiatedFlask.Clear();
} //}
void preChecks(double beat) void preChecks(double beat)
{ {
@ -581,7 +880,7 @@ namespace HeavenStudio.Games
fiveHeart fiveHeart
} }
public struct QueuedFlask public struct QueuedFlask //for the offscreen stuff
{ {
public double beat; public double beat;
public flaskHeart type; public flaskHeart type;
@ -861,22 +1160,33 @@ namespace HeavenStudio.Games
public void mainBoxGuy(double beat, int reqAction) public void mainBoxGuy(double beat, int reqAction)
{ {
Animator box;
if (!isDay)
{
box = boxPerson;
}
else
{
box = boxPersonDay;
}
switch (reqAction) switch (reqAction)
{ {
case 0: case 0:
boxPerson.DoScaledAnimationAsync("BoxTakeAway", .5f); box.DoScaledAnimationAsync("BoxTakeAway", .5f);
break; break;
case 1: case 1:
boxPerson.DoScaledAnimationAsync("BoxPutBack", .5f); box.DoScaledAnimationAsync("BoxPutBack", .5f);
break; break;
case 2: case 2:
boxPerson.DoScaledAnimationAsync("NoBox", 0f); box.DoScaledAnimationAsync("NoBox", 0f);
break; break;
case 3: case 3:
boxPerson.DoScaledAnimationAsync("BoxIdle", 0f); box.DoScaledAnimationAsync("BoxIdle", 0f);
break; break;
default: default:
boxPerson.DoScaledAnimationAsync("BoxTakeAway", .5f); box.DoScaledAnimationAsync("BoxTakeAway", .5f);
break; break;
} }
} }
@ -1104,7 +1414,7 @@ namespace HeavenStudio.Games
new BeatAction.Action((caller.startBeat + caller.timer) + .25f, delegate { instance.onDownFlask(); }) new BeatAction.Action((caller.startBeat + caller.timer) + .25f, delegate { instance.onDownFlask(); })
}); });
if(instance.reqHeartsContainer[0].heartCounter > 0) if (instance.reqHeartsContainer[0].heartCounter > 0)
{ {
if (instance.reqHeartsContainer[0].heartType == flaskHeart.twoHeart) if (instance.reqHeartsContainer[0].heartType == flaskHeart.twoHeart)
{ {
@ -1113,7 +1423,6 @@ namespace HeavenStudio.Games
heartDetails heart = instance.reqHeartsContainer[0]; heartDetails heart = instance.reqHeartsContainer[0];
heart.heartCounter--; heart.heartCounter--;
instance.reqHeartsContainer[0] = heart; instance.reqHeartsContainer[0] = heart;
} }
else if (instance.reqHeartsContainer[0].heartType == flaskHeart.threeHeart) else if (instance.reqHeartsContainer[0].heartType == flaskHeart.threeHeart)
@ -1152,7 +1461,7 @@ namespace HeavenStudio.Games
} }
} }
if(instance.reqHeartsContainer[0].heartCounter <= 0) if (instance.reqHeartsContainer[0].heartCounter <= 0)
{ {
instance.reqHeartsContainer.RemoveAt(0); instance.reqHeartsContainer.RemoveAt(0);
} }
@ -1192,12 +1501,17 @@ namespace HeavenStudio.Games
Destroy(instance.girlInstantiatedFlask[0].gameObject); Destroy(instance.girlInstantiatedFlask[0].gameObject);
instance.boyFlaskBreak.Play(); instance.boyFlaskBreak.Play();
instance.girlInstantiatedFlask.RemoveAt(0); instance.girlInstantiatedFlask.RemoveAt(0);
instance.reqHeartsContainer.RemoveAt(0);
if(instance.reqHeartsContainer.Count > 0)
{
instance.reqHeartsContainer.RemoveAt(0);
}
} }
public static void onMissWhenHold(PlayerActionEvent caller) public static void onMissWhenHold(PlayerActionEvent caller)
{ {
Debug.LogWarning(caller.timer); Debug.LogWarning(caller.timer);
instance.reqHeartsContainer.RemoveAt(0);
LoveLabForGirlFlask spawnedFlask = Instantiate(instance.labGirlFlaskObj, instance.transform).AddComponent<LoveLabForGirlFlask>(); LoveLabForGirlFlask spawnedFlask = Instantiate(instance.labGirlFlaskObj, instance.transform).AddComponent<LoveLabForGirlFlask>();
spawnedFlask.onMissWhenHold((caller.startBeat + caller.timer) + 1f); spawnedFlask.onMissWhenHold((caller.startBeat + caller.timer) + 1f);
} }

View file

@ -14,8 +14,6 @@ namespace HeavenStudio.Games.Scripts_LoveLab
[SerializeField] private SuperCurveObject.Path path; [SerializeField] private SuperCurveObject.Path path;
private double pathStartBeat = double.MinValue; private double pathStartBeat = double.MinValue;
private Conductor conductor; private Conductor conductor;
public static double currentBeat;
void Awake() void Awake()
{ {
@ -41,6 +39,26 @@ namespace HeavenStudio.Games.Scripts_LoveLab
} }
} }
public void customShakes(double beat)
{
path = game.GetPath("GuyFlaskIn");
UpdateLastRealPos();
pathStartBeat = beat - 1f;
Vector3 pos = GetPathPositionFromBeat(path, pathStartBeat, pathStartBeat);
transform.position = pos;
gameObject.SetActive(true);
BeatAction.New(game, new List<BeatAction.Action>
{
new BeatAction.Action(beat, delegate
{
Destroy(this.gameObject);
}),
});
}
#region 1 heart #region 1 heart
public void Init(double beat) public void Init(double beat)
{ {
@ -49,7 +67,6 @@ namespace HeavenStudio.Games.Scripts_LoveLab
//game.canCallForFlask = false; //game.canCallForFlask = false;
game.ScheduleInput(beat, 2f, LoveLab.InputAction_BasicPressing, onOneCatch, onMiss, onEmpty); game.ScheduleInput(beat, 2f, LoveLab.InputAction_BasicPressing, onOneCatch, onMiss, onEmpty);
currentBeat = beat;
path = game.GetPath("GuyFlaskIn"); path = game.GetPath("GuyFlaskIn");
UpdateLastRealPos(); UpdateLastRealPos();
pathStartBeat = beat - 1f; pathStartBeat = beat - 1f;
@ -114,7 +131,6 @@ namespace HeavenStudio.Games.Scripts_LoveLab
//game.canCallForFlask = false; //game.canCallForFlask = false;
game.ScheduleInput(beat, 2f, LoveLab.InputAction_BasicPressing, onOneOffCatch, onMiss, onEmpty); game.ScheduleInput(beat, 2f, LoveLab.InputAction_BasicPressing, onOneOffCatch, onMiss, onEmpty);
currentBeat = beat;
path = game.GetPath("GuyFlaskIn"); path = game.GetPath("GuyFlaskIn");
UpdateLastRealPos(); UpdateLastRealPos();
pathStartBeat = beat - 1f; pathStartBeat = beat - 1f;
@ -175,7 +191,6 @@ namespace HeavenStudio.Games.Scripts_LoveLab
game.ScheduleInput(beat, 2f, LoveLab.InputAction_BasicPressing, onTwoCatch, onMiss, onEmpty); game.ScheduleInput(beat, 2f, LoveLab.InputAction_BasicPressing, onTwoCatch, onMiss, onEmpty);
currentBeat = beat;
path = game.GetPath("GuyFlaskIn"); path = game.GetPath("GuyFlaskIn");
UpdateLastRealPos(); UpdateLastRealPos();
pathStartBeat = beat - 1f; pathStartBeat = beat - 1f;
@ -220,7 +235,7 @@ namespace HeavenStudio.Games.Scripts_LoveLab
LoveLab.heartDetails heart = new LoveLab.heartDetails(); LoveLab.heartDetails heart = new LoveLab.heartDetails();
heart.heartCounter = 1; heart.heartCounter = 1;
heart.heartType = LoveLab.flaskHeart.twoHeart; heart.heartType = LoveLab.flaskHeart.twoHeart;
Debug.LogWarning("counter: " + heart.heartCounter);
game.reqHeartsContainer.Add(heart); game.reqHeartsContainer.Add(heart);
} }
@ -253,7 +268,6 @@ namespace HeavenStudio.Games.Scripts_LoveLab
game.ScheduleInput(beat, 4f, LoveLab.InputAction_BasicPressing, onThreeCatch, onMiss, onEmpty); game.ScheduleInput(beat, 4f, LoveLab.InputAction_BasicPressing, onThreeCatch, onMiss, onEmpty);
currentBeat = beat;
path = game.GetPath("GuyFlaskIn"); path = game.GetPath("GuyFlaskIn");
UpdateLastRealPos(); UpdateLastRealPos();
pathStartBeat = beat - 1f; pathStartBeat = beat - 1f;
@ -357,7 +371,6 @@ namespace HeavenStudio.Games.Scripts_LoveLab
game.ScheduleInput(beat, 4f, LoveLab.InputAction_BasicPressing, onFiveCatch, onMiss, onEmpty); game.ScheduleInput(beat, 4f, LoveLab.InputAction_BasicPressing, onFiveCatch, onMiss, onEmpty);
currentBeat = beat;
path = game.GetPath("GuyFlaskIn"); path = game.GetPath("GuyFlaskIn");
UpdateLastRealPos(); UpdateLastRealPos();
pathStartBeat = beat - 1f; pathStartBeat = beat - 1f;
@ -483,7 +496,11 @@ namespace HeavenStudio.Games.Scripts_LoveLab
Destroy(LoveLab.instance.girlInstantiatedFlask[0].gameObject); Destroy(LoveLab.instance.girlInstantiatedFlask[0].gameObject);
LoveLab.instance.boyFlaskBreak.Play(); LoveLab.instance.boyFlaskBreak.Play();
LoveLab.instance.girlInstantiatedFlask.RemoveAt(0); LoveLab.instance.girlInstantiatedFlask.RemoveAt(0);
LoveLab.instance.reqHeartsContainer.RemoveAt(0);
if(LoveLab.instance.reqHeartsContainer.Count > 0)
{
LoveLab.instance.reqHeartsContainer.RemoveAt(0);
}
} }
public static void onMissWhenHold(PlayerActionEvent caller) public static void onMissWhenHold(PlayerActionEvent caller)

View file

@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1 16:10: 1
16:9: 1 16:9: 1
Others: 1 Others: 1
bundleVersion: 1.0.2 bundleVersion: 1.0.9
preloadedAssets: preloadedAssets:
- {fileID: 102900000, guid: 5348c08b82446e0478cee8bda6c02cfc, type: 3} - {fileID: 102900000, guid: 5348c08b82446e0478cee8bda6c02cfc, type: 3}
metroInputSource: 0 metroInputSource: 0
@ -158,11 +158,11 @@ PlayerSettings:
applicationIdentifier: applicationIdentifier:
Standalone: com.RHeavenStudio.Heaven-Studio Standalone: com.RHeavenStudio.Heaven-Studio
buildNumber: buildNumber:
Standalone: 100002 Standalone: 100009
iPhone: 0 iPhone: 0
tvOS: 0 tvOS: 0
overrideDefaultApplicationIdentifier: 0 overrideDefaultApplicationIdentifier: 0
AndroidBundleVersionCode: 100002 AndroidBundleVersionCode: 100009
AndroidMinSdkVersion: 22 AndroidMinSdkVersion: 22
AndroidTargetSdkVersion: 0 AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 1 AndroidPreferredInstallLocation: 1
@ -408,6 +408,9 @@ PlayerSettings:
- m_BuildTarget: iOSSupport - m_BuildTarget: iOSSupport
m_APIs: 10000000 m_APIs: 10000000
m_Automatic: 1 m_Automatic: 1
- m_BuildTarget: WindowsStandaloneSupport
m_APIs: 02000000
m_Automatic: 1
m_BuildTargetVRSettings: [] m_BuildTargetVRSettings: []
m_DefaultShaderChunkSizeInMB: 16 m_DefaultShaderChunkSizeInMB: 16
m_DefaultShaderChunkCount: 0 m_DefaultShaderChunkCount: 0