mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 11:57:40 +02:00
Space Dance and Crop Stomp visual improvements + canvasScroll (#450)
* sprites1 * papapapunch * dancers sheet done * crop stomp * Particulate * Added veggie bag and particle to crop stomp, wip though * Space dance scrolling background has been added * cool * Canvas Scroll hype * Canvas scroll implemented in space soccer * 4k * gramps wip * more * assbun conflict fixed + long hair fix * Space dance bop modernization and fixes * ok * sprites done * wait. * fixed space dance stuff * Made miss return to idle * catchy tune 3 * epic --------- Co-authored-by: ev <85412919+evdial@users.noreply.github.com> Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
@ -32,6 +32,16 @@ namespace HeavenStudio.Games.Loaders
|
||||
new Param("mute", false, "Mute", "Should the mole laugh sound be muted?")
|
||||
}
|
||||
},
|
||||
new GameAction("plantCollect", "Veggie Collection Values")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; CropStomp.instance.SetCollectThresholds(e["threshold"], e["limit"]); },
|
||||
defaultLength = 0.5f,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("threshold", new EntityTypes.Integer(1, 80, 8), "Threshold", "For each time the threshold is met a new plant will appear in the veggie bag."),
|
||||
new Param("limit", new EntityTypes.Integer(1, 1000, 80), "Limit", "What is the limit for plants collected?")
|
||||
}
|
||||
}
|
||||
},
|
||||
new List<string>() {"ntr", "keep"},
|
||||
"ntrstomp", "en",
|
||||
@ -83,6 +93,8 @@ namespace HeavenStudio.Games
|
||||
|
||||
private Tween shakeTween;
|
||||
|
||||
public ParticleSystem hitParticle;
|
||||
|
||||
public static CropStomp instance;
|
||||
|
||||
private void Awake()
|
||||
@ -274,6 +286,18 @@ namespace HeavenStudio.Games
|
||||
isFlicking = false;
|
||||
}
|
||||
|
||||
public void SetCollectThresholds(int thresholdEvolve, int limit)
|
||||
{
|
||||
farmer.plantThreshold = thresholdEvolve;
|
||||
farmer.plantLimit = limit;
|
||||
farmer.UpdatePlants();
|
||||
}
|
||||
|
||||
public void CollectPlant()
|
||||
{
|
||||
farmer.CollectPlant();
|
||||
}
|
||||
|
||||
private void PlayAnims()
|
||||
{
|
||||
// Step.
|
||||
|
@ -14,9 +14,37 @@ namespace HeavenStudio.Games.Scripts_CropStomp
|
||||
|
||||
PlayerActionEvent stomp;
|
||||
|
||||
[SerializeField] private Transform collectedHolder;
|
||||
|
||||
[SerializeField] private GameObject plantLeftRef;
|
||||
[SerializeField] private GameObject plantRightRef;
|
||||
private List<GameObject> spawnedPlants = new List<GameObject>();
|
||||
|
||||
[SerializeField] private float plantDistance = 0.5f;
|
||||
|
||||
public int plantThreshold = 8;
|
||||
|
||||
public int plantLimit = 80;
|
||||
|
||||
private static int collectedPlants = 0;
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (!Conductor.instance.isPlaying)
|
||||
{
|
||||
collectedPlants = 0;
|
||||
UpdatePlants();
|
||||
}
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
game = CropStomp.instance;
|
||||
if (!Conductor.instance.isPlaying)
|
||||
{
|
||||
collectedPlants = 0;
|
||||
}
|
||||
UpdatePlants();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@ -40,6 +68,33 @@ namespace HeavenStudio.Games.Scripts_CropStomp
|
||||
}
|
||||
}
|
||||
|
||||
public void CollectPlant()
|
||||
{
|
||||
if (collectedPlants >= plantLimit) return;
|
||||
collectedPlants++;
|
||||
UpdatePlants();
|
||||
}
|
||||
|
||||
public void UpdatePlants()
|
||||
{
|
||||
if (spawnedPlants.Count > 0)
|
||||
{
|
||||
foreach (var plant in spawnedPlants)
|
||||
{
|
||||
Destroy(plant);
|
||||
}
|
||||
spawnedPlants.Clear();
|
||||
}
|
||||
for (int i = 0; i < collectedPlants && i < plantLimit; i += plantThreshold)
|
||||
{
|
||||
GameObject spawnedPlant = Instantiate(((i / plantThreshold) % 2 == 0) ? plantRightRef : plantLeftRef, collectedHolder);
|
||||
spawnedPlant.transform.localPosition = new Vector3(0, (i / plantThreshold) * plantDistance + plantDistance, 0);
|
||||
spawnedPlant.GetComponent<SpriteRenderer>().sortingOrder = (i / plantThreshold) - 2;
|
||||
spawnedPlant.SetActive(true);
|
||||
spawnedPlants.Add(spawnedPlant);
|
||||
}
|
||||
}
|
||||
|
||||
private void Just(PlayerActionEvent caller, float state)
|
||||
{
|
||||
// REMARK: does not count for performance
|
||||
@ -73,6 +128,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
|
||||
{
|
||||
game.Stomp();
|
||||
game.bodyAnim.Play("Stomp", 0, 0);
|
||||
|
||||
}
|
||||
nextStompBeat += 2f;
|
||||
stomp?.Disable();
|
||||
|
@ -204,6 +204,10 @@ namespace HeavenStudio.Games.Scripts_CropStomp
|
||||
{
|
||||
var veggieScale = Mathf.Min(1.5f - pickPosition, 1f);
|
||||
veggieTrans.localScale = Vector2.one * veggieScale;
|
||||
if (pickPosition >= 1f)
|
||||
{
|
||||
game.CollectPlant();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,6 +223,10 @@ namespace HeavenStudio.Games.Scripts_CropStomp
|
||||
|
||||
var cond = Conductor.instance;
|
||||
|
||||
ParticleSystem spawnedHit = Instantiate(game.hitParticle, game.hitParticle.transform.parent);
|
||||
|
||||
spawnedHit.Play();
|
||||
|
||||
veggieState = 1;
|
||||
game.ScheduleInput(targetBeat, isMole ? 0.5f : 1f, InputType.STANDARD_UP, PickJust, PickMiss, Out);
|
||||
targetBeat = targetBeat + (isMole ? 0.5f : 1f);
|
||||
|
Reference in New Issue
Block a user