Merge pull request #33 from CarsonKompon/karate-man-new-hits

Added Cooking Pot, Alien, and Pot hit stars to Karate Man
This commit is contained in:
Jenny Crowe 2022-03-02 21:29:27 -07:00 committed by GitHub
commit eba80da200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 288 additions and 12 deletions

View file

@ -6726,6 +6726,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2894176741642927925}
- {fileID: 1457329406503294050}
m_Father: {fileID: 7248900332475218834}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -7030,6 +7031,7 @@ MonoBehaviour:
Holder: {fileID: 7248900331917783119}
Sprite: {fileID: 7248900332269585492}
BulbLightSprite: {fileID: 8800416197462662414}
CookingPotLid: {fileID: 8704477285803082347}
Shadow: {fileID: 7248900331919671867}
isThrown: 0
isHit: 0
@ -12509,7 +12511,7 @@ ParticleSystem:
startLifetime:
serializedVersion: 2
minMaxState: 0
scalar: 0.22
scalar: 0.33
minScalar: 5
maxCurve:
serializedVersion: 2
@ -14417,7 +14419,7 @@ ParticleSystem:
radial:
serializedVersion: 2
minMaxState: 0
scalar: 10.21
scalar: 15
minScalar: 0
maxCurve:
serializedVersion: 2
@ -14470,7 +14472,7 @@ ParticleSystem:
speedModifier:
serializedVersion: 2
minMaxState: 0
scalar: 1.83
scalar: 0.8
minScalar: 1
maxCurve:
serializedVersion: 2
@ -17795,6 +17797,8 @@ MonoBehaviour:
- {fileID: -3530312539838775474, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 8671423413994339737, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: -6341196331951941137, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 6243727673011286339, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: -8767211005568948338, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: -6283416824598814145, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
BarrelSprites:
- {fileID: 6524922379630696755, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
@ -17802,6 +17806,11 @@ MonoBehaviour:
- {fileID: -7998309181045564909, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: -7906004722935515527, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 5805539206011318834, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
CookingPotSprites:
- {fileID: 6243727673011286339, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 561377664857987667, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
OtherSprites:
- {fileID: -6283416824598814145, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
BGSprites:
- Sprites:
- {fileID: 21300000, guid: 72431c7c58f54e848bcb7527635bb72b, type: 3}
@ -17816,6 +17825,7 @@ MonoBehaviour:
BGColor: {r: 0.94117653, g: 0.91372555, b: 0.43921572, a: 1}
Shadow: 0
ShadowColor: {r: 0, g: 0, b: 0, a: 0}
potHitEffect: {fileID: 7248900332593533644}
comboRef: {fileID: 1174851578296134715}
HIT3Ref: {fileID: 6398113137460299953}
Numbers:
@ -18191,6 +18201,88 @@ Transform:
m_Father: {fileID: 8457699647532782750}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8704477285803082347
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1457329406503294050}
- component: {fileID: 2851794217705847224}
m_Layer: 0
m_Name: CookingPotLid
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1457329406503294050
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8704477285803082347}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.07, y: 0.52, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 7248900332269585493}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &2851794217705847224
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8704477285803082347}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 60
m_Sprite: {fileID: 561377664857987667, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1.9444444, y: 1.9444444}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &8746018100916256658
GameObject:
m_ObjectHideFlags: 0

View file

@ -218,6 +218,15 @@ TextureImporter:
- first:
213: 756708653002075470
second: karateman_combo_crouch_toIdle_leg
- first:
213: 6243727673011286339
second: karateman_cookingpot
- first:
213: 561377664857987667
second: karateman_cookingpot_lid
- first:
213: -8767211005568948338
second: karateman_alien
externalObjects: {}
serializedVersion: 11
mipmaps:
@ -1872,6 +1881,69 @@ TextureImporter:
indices:
edges: []
weights: []
- serializedVersion: 2
name: karateman_cookingpot
rect:
serializedVersion: 2
x: 3502
y: 1466
width: 294
height: 155
alignment: 9
pivot: {x: 0.48875457, y: 0.6137561}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 3413d18ec3d26a650800000000000000
internalID: 6243727673011286339
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: karateman_cookingpot_lid
rect:
serializedVersion: 2
x: 3520
y: 1752
width: 257
height: 121
alignment: 9
pivot: {x: 0.4871356, y: 0.34517047}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 35ad2ba030a6ac700800000000000000
internalID: 561377664857987667
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: karateman_alien
rect:
serializedVersion: 2
x: 3478
y: 1114
width: 276
height: 256
alignment: 9
pivot: {x: 0.5005042, y: 0.48580885}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: e87ea268a0c945680800000000000000
internalID: -8767211005568948338
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []

View file

@ -0,0 +1,53 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
namespace RhythmHeavenMania.Games.KarateMan
{
// Physics in Rhythm Heaven Mania? nah im just fuckin lazy
public class CookingPotDestroyEffect : MonoBehaviour
{
public SpriteRenderer SpriteRenderer;
public int spriteIndex;
public int index;
private float rotationSpeed;
public GameObject pot;
private void Start()
{
SpriteRenderer sr = gameObject.AddComponent<SpriteRenderer>();
sr.sprite = KarateMan.instance.CookingPotSprites[1];
Rigidbody2D rb2d = gameObject.AddComponent<Rigidbody2D>();
rb2d.gravityScale = 5;
rb2d.collisionDetectionMode = CollisionDetectionMode2D.Continuous;
rb2d.AddForce(Vector3.up * Random.Range(875, 925));
rotationSpeed = Random.Range(100, 200);
PhysicsMaterial2D mat = new PhysicsMaterial2D();
mat.bounciness = 0;
StartCoroutine(FadeOut());
gameObject.name = "cookingpot_lid";
}
private void Update()
{
transform.eulerAngles -= new Vector3(0, 0, rotationSpeed * Time.deltaTime);
transform.position = new Vector3(pot.transform.position.x, transform.position.y, transform.position.z);
}
private IEnumerator FadeOut()
{
yield return new WaitForSeconds(Conductor.instance.secPerBeat * 3);
Destroy(gameObject);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 523d89bc8ebbac84dbe347ffa8fb0c04
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -12,8 +12,6 @@ namespace RhythmHeavenMania.Games.KarateMan
[Header("Components")]
public Animator anim;
public GameObject HitEffect;
public ParticleSystem HitParticle;
public ParticleSystem RockParticle;
public GameObject BulbHit;
[SerializeField] private SpriteRenderer head;
[SerializeField] private Sprite[] heads;
@ -268,7 +266,7 @@ namespace RhythmHeavenMania.Games.KarateMan
}
else
{
if (p.type == 2 || p.type == 3 || p.type == 4 || p.type == 6)
if (p.type == 2 || p.type == 3 || p.type == 4 || p.type == 6 || p.type == 999)
{
punchLeft = false;
}

View file

@ -14,7 +14,10 @@ namespace RhythmHeavenMania.Games.KarateMan
Pot = 0,
Rock = 2,
Ball = 3,
TacoBell = 6
CookingPot = 6,
Alien = 7,
TacoBell = 999
}
public enum LightBulbType
@ -65,6 +68,8 @@ namespace RhythmHeavenMania.Games.KarateMan
public Sprite[] ObjectSprites;
public Sprite[] BarrelSprites;
public Sprite[] CookingPotSprites;
public Sprite[] OtherSprites;
public List<BGSpriteC> BGSprites;
public SpriteRenderer BGSprite;
@ -84,6 +89,8 @@ namespace RhythmHeavenMania.Games.KarateMan
private float bgBeat;
public ParticleSystem potHitEffect;
public GameObject comboRef;
public GameObject HIT3Ref;
@ -150,6 +157,8 @@ namespace RhythmHeavenMania.Games.KarateMan
p.createBeat = beat;
p.isThrown = true;
p.type = type;
if(type <= ObjectSprites.Length)
p.Sprite.GetComponent<SpriteRenderer>().sprite = ObjectSprites[type];
if (combo)
@ -210,7 +219,25 @@ namespace RhythmHeavenMania.Games.KarateMan
});
break;
case 6:
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/cookingPot";
break;
case 7:
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/alienHit";
break;
case 999:
p.Sprite.GetComponent<SpriteRenderer>().sprite = OtherSprites[0];
if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f)
outSnd = "karateman/objectOut";
else
outSnd = "karateman/offbeatObjectOut";
p.hitSnd = "karateman/tacobell";
break;
}

View file

@ -16,6 +16,7 @@ namespace RhythmHeavenMania.Games.KarateMan
private GameObject newHolder;
public GameObject Sprite;
public GameObject BulbLightSprite;
public GameObject CookingPotLid;
private SpriteRenderer spriteComp;
public GameObject Shadow;
private SpriteRenderer shadowSpriteComp;
@ -70,6 +71,9 @@ namespace RhythmHeavenMania.Games.KarateMan
else
hitLength = 14f;
if (type == 6)
CookingPotLid.SetActive(true);
/*if (combo)
{
if (comboIndex == 0)
@ -266,7 +270,7 @@ namespace RhythmHeavenMania.Games.KarateMan
switch (type)
{
case 0:
// HitParticle.Play();
KarateMan.instance.potHitEffect.Play();
break;
case 1:
GameObject bulbHit = Instantiate(KarateJoe.instance.BulbHit);
@ -275,11 +279,19 @@ namespace RhythmHeavenMania.Games.KarateMan
Destroy(bulbHit, 0.7f);
break;
case 2:
// RockParticle.Play();
// TODO: Rock destroy particle effect
break;
case 4:
BarrelDestroy(false);
break;
case 6:
// TODO: Rock destroy particle effect
CookingPotLid.SetActive(false);
CookingPotDestroy();
break;
case 999:
Jukebox.PlayOneShotGame("karateman/rockHit");
break;
}
if (!kick)
@ -327,6 +339,17 @@ namespace RhythmHeavenMania.Games.KarateMan
Holder.transform.parent = newHolder.transform;
}
public void CookingPotDestroy()
{
GameObject lid = new GameObject();
lid.transform.localPosition = Holder.transform.localPosition;
lid.transform.parent = transform.parent;
lid.transform.localScale = Holder.transform.localScale;
CookingPotDestroyEffect cpde = lid.AddComponent<CookingPotDestroyEffect>();
cpde.pot = Sprite;
}
public void BarrelDestroy(bool combo)
{
for (int i = 0; i < 8; i++)

View file

@ -263,7 +263,7 @@ namespace RhythmHeavenMania
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("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 999); }, 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),