WIP: Add new Item: Piano #1
@@ -0,0 +1,42 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
namespace Piano
|
||||||
|
{
|
||||||
|
public class PianoBehaviour : AnvilBehaviour
|
||||||
|
{
|
||||||
|
private AudioClip pianoClip;
|
||||||
|
|
||||||
|
public override void OnLoad()
|
||||||
|
{
|
||||||
|
pianoClip = AGDAPI.Audio.LoadClip("assets/pianodrop.mp3");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnUse(ItemUseContext ctx)
|
||||||
|
{
|
||||||
|
AGDAPI.Audio.PlayClip(pianoClip, ctx.Player);
|
||||||
|
ctx.StartCoroutine(TimedDrop(ctx));
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerator TimedDrop(ItemUseContext ctx)
|
||||||
|
{
|
||||||
|
float hoverTime = 2.5f;
|
||||||
|
float hoverHeight = 8f;
|
||||||
|
|
||||||
|
var thrown = ctx.SpawnThrownObject(suspend: true);
|
||||||
|
if (thrown == null)
|
||||||
|
yield break;
|
||||||
|
|
||||||
|
thrown.transform.position = ctx.Player.transform.position + Vector3.up * hoverHeight;
|
||||||
|
|
||||||
|
yield return new WaitForSeconds(hoverTime);
|
||||||
|
|
||||||
|
thrown.Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float GetImpactDamage()
|
||||||
|
{
|
||||||
|
return base.GetImpactDamage() * 2.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
# M.O.G.D-Modpack
|
# M.O.G.D-Modpack
|
||||||
|
|
||||||
Ministry Of Gentlemanly Disputing's official modpack
|
Ministry Of Gentlemenly Disputing's official modpack
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
ManifestFileVersion: 0
|
||||||
|
UnityVersion: 6000.1.17f1
|
||||||
|
CRC: 3151077677
|
||||||
|
HashAppended: 0
|
||||||
|
AssetBundleManifest:
|
||||||
|
AssetBundleInfos:
|
||||||
|
Info_0:
|
||||||
|
Name: items
|
||||||
|
Dependencies: {}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"example.piano/piano.title": "Piano",
|
||||||
|
"example.piano/piano.desc": "The Science Show! Pianos! Who's idea was this?"
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"id": "piano",
|
||||||
|
"title": "Piano",
|
||||||
|
"titleKey": "piano/piano.title",
|
||||||
|
"description": "Summons a falling piano - bigger damage, lower fire rate.",
|
||||||
|
"descriptionKey": "piano/piano.desc",
|
||||||
|
"iconPath": "assets/piano.png",
|
||||||
|
"basedOn": "Anvil",
|
||||||
|
"category": "Gun",
|
||||||
|
"pool": "Normal",
|
||||||
|
"spawnChanceMultiplier": 1,
|
||||||
|
"triggerRadius": 3.5,
|
||||||
|
"effectDuration": 4,
|
||||||
|
"prefabId": "held",
|
||||||
|
"pedestalPrefabId": "pedestal",
|
||||||
|
"thrownVisualPrefabId": "thrown",
|
||||||
|
"hideVanillaThrownMesh": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
ManifestFileVersion: 0
|
||||||
|
UnityVersion: 6000.1.17f1
|
||||||
|
CRC: 3627608075
|
||||||
|
Hashes:
|
||||||
|
AssetFileHash:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 80ee5c21f9e30f82a83c953597a48257
|
||||||
|
TypeTreeHash:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 8b020484f3856250fa4d2d05c7bc1cea
|
||||||
|
IncrementalBuildHash:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: ae7ae7068b4ded7243602e1cd31c236a
|
||||||
|
HashAppended: 0
|
||||||
|
ClassTypes:
|
||||||
|
- Class: 1
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
- Class: 4
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
- Class: 23
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
- Class: 33
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
- Class: 43
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
- Class: 65
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
SerializeReferenceClassIdentifiers: []
|
||||||
|
Assets:
|
||||||
|
- Assets/ItemPrefabs/ItemThrown.prefab
|
||||||
|
- Assets/ItemPrefabs/ItemPedestal.prefab
|
||||||
|
- Assets/ItemPrefabs/ItemHeld.prefab
|
||||||
|
- Assets/ItemPrefabs/ItemDrop.prefab
|
||||||
|
Dependencies: []
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"modId": "piano",
|
||||||
|
"name": "Piano",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"enabled": true,
|
||||||
|
"entryAssembly": "bin/Piano.dll",
|
||||||
|
"entryType": "Piano.PianoPlugin"
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"collectionId": 1,
|
||||||
|
"bundles": ["bundles/items"],
|
||||||
|
"prefabs": [
|
||||||
|
{ "id": "held", "assetName": "PianoHeld", "spawnable": false },
|
||||||
|
{ "id": "pedestal", "assetName": "PianoPedestal", "spawnable": false },
|
||||||
|
{ "id": "thrown", "assetName": "PianoLaunched", "spawnable": false }
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user