Merge pull request #35 from CarsonKompon/karate-man-hit-2

Added Hit Two and Hit Three alt (from RHDS) to Karate Man
This commit is contained in:
Jenny Crowe 2022-03-03 14:42:58 -07:00 committed by GitHub
commit 37ddad7bb0
6 changed files with 95 additions and 9 deletions

View file

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 4c9b12983f5db8f47825744ae20b55f0
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 343bf4faedef49e41ae0d19006e3ad2e
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 6abad4e4e0bb4134d9cc5e495329896c
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View file

@ -20,6 +20,14 @@ namespace RhythmHeavenMania.Games.KarateMan
TacoBell = 999 TacoBell = 999
} }
public enum HitThree
{
HitTwo,
HitThree,
HitThreeAlt,
HitFour
}
public enum LightBulbType public enum LightBulbType
{ {
Normal, Normal,
@ -303,7 +311,9 @@ namespace RhythmHeavenMania.Games.KarateMan
if (timeToEvent <= 1f && timeToEvent > 0f && !cuedVoices.Contains(hitEvent)) if (timeToEvent <= 1f && timeToEvent > 0f && !cuedVoices.Contains(hitEvent))
{ {
cuedVoices.Add(hitEvent); cuedVoices.Add(hitEvent);
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("karateman/hit", hitEvent.beat - hitVoiceOffset * Conductor.instance.songBpm / 60f) }); var sound = "karateman/hit";
if (hitEvent.type == (int)KarateMan.HitThree.HitThreeAlt) sound += "Alt";
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound(sound, hitEvent.beat - hitVoiceOffset * Conductor.instance.songBpm / 60f) });
} }
} }
} }
@ -338,9 +348,16 @@ namespace RhythmHeavenMania.Games.KarateMan
bop.startBeat = beat; bop.startBeat = beat;
} }
public void Hit3(float beat) public void Hit2(float beat)
{ {
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("karateman/three", beat + 0.5f) }); MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("karateman/two", beat + 0.5f) });
}
public void Hit3(float beat, bool alt = false)
{
var sound = "karateman/three";
if (alt) sound += "Alt";
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound(sound, beat + 0.5f) });
GameObject hit3 = Instantiate(HIT3Ref, this.transform); GameObject hit3 = Instantiate(HIT3Ref, this.transform);
hit3.transform.GetChild(0).GetChild(1).GetComponent<SpriteRenderer>().sprite = Numbers[2]; hit3.transform.GetChild(0).GetChild(1).GetComponent<SpriteRenderer>().sprite = Numbers[2];
BeatAction.New(hit3, new List<BeatAction.Action>() BeatAction.New(hit3, new List<BeatAction.Action>()

View file

@ -270,7 +270,7 @@ namespace RhythmHeavenMania.Games.KarateMan
switch (type) switch (type)
{ {
case 0: case 0:
KarateMan.instance.potHitEffect.Play(); if(!combo) KarateMan.instance.potHitEffect.Play();
break; break;
case 1: case 1:
GameObject bulbHit = Instantiate(KarateJoe.instance.BulbHit); GameObject bulbHit = Instantiate(KarateJoe.instance.BulbHit);

View file

@ -230,13 +230,16 @@ namespace RhythmHeavenMania
new GameAction("hit3", delegate new GameAction("hit3", delegate
{ {
var e = eventCaller.currentEntity; var e = eventCaller.currentEntity;
if(e.toggle) switch ((KarateMan.HitThree)e.type)
KarateMan.instance.Hit4(e.beat); {
else case KarateMan.HitThree.HitTwo: KarateMan.instance.Hit2(e.beat); break;
KarateMan.instance.Hit3(e.beat); case KarateMan.HitThree.HitThreeAlt: KarateMan.instance.Hit3(e.beat, true); break;
case KarateMan.HitThree.HitFour: KarateMan.instance.Hit4(e.beat); break;
default: KarateMan.instance.Hit3(e.beat); break;
}
}, 1f, false, new List<Param>() }, 1f, false, new List<Param>()
{ {
new Param("toggle", false, "Hit 4", "Whether or not the \"hit 4!\" sound should be played instead") new Param("type", KarateMan.HitThree.HitThree, "Type", "What should be called out")
}), }),
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true), new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 1f, true),
new GameAction("set background color", delegate { new GameAction("set background color", delegate {