diff --git a/Piano.dll b/Piano.dll new file mode 100644 index 0000000..20cdb3c --- /dev/null +++ b/Piano.dll @@ -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; + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 7a95467..f9e032a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # M.O.G.D-Modpack -Ministry Of Gentlemanly Disputing's official modpack \ No newline at end of file +Ministry Of Gentlemenly Disputing's official modpack \ No newline at end of file diff --git a/bundles b/bundles new file mode 100644 index 0000000..addfb02 Binary files /dev/null and b/bundles differ diff --git a/bundles.manifest b/bundles.manifest new file mode 100644 index 0000000..4156eb9 --- /dev/null +++ b/bundles.manifest @@ -0,0 +1,9 @@ +ManifestFileVersion: 0 +UnityVersion: 6000.1.17f1 +CRC: 3151077677 +HashAppended: 0 +AssetBundleManifest: + AssetBundleInfos: + Info_0: + Name: items + Dependencies: {} diff --git a/en.json b/en.json new file mode 100644 index 0000000..9d16d61 --- /dev/null +++ b/en.json @@ -0,0 +1,4 @@ +{ + "example.piano/piano.title": "Piano", + "example.piano/piano.desc": "The Science Show! Pianos! Who's idea was this?" +} diff --git a/items b/items new file mode 100644 index 0000000..432a5cc Binary files /dev/null and b/items differ diff --git a/items.json b/items.json new file mode 100644 index 0000000..2e5e632 --- /dev/null +++ b/items.json @@ -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 + } + ] +} diff --git a/items.manifest b/items.manifest new file mode 100644 index 0000000..9f281dd --- /dev/null +++ b/items.manifest @@ -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: [] diff --git a/mod.json b/mod.json new file mode 100644 index 0000000..7cf469f --- /dev/null +++ b/mod.json @@ -0,0 +1,8 @@ +{ + "modId": "piano", + "name": "Piano", + "version": "1.0.0", + "enabled": true, + "entryAssembly": "bin/Piano.dll", + "entryType": "Piano.PianoPlugin" +} diff --git a/piano.png b/piano.png new file mode 100644 index 0000000..3c12b57 Binary files /dev/null and b/piano.png differ diff --git a/pianodrop.mp3 b/pianodrop.mp3 new file mode 100644 index 0000000..2527548 Binary files /dev/null and b/pianodrop.mp3 differ diff --git a/prefabs.json b/prefabs.json new file mode 100644 index 0000000..35f6a8e --- /dev/null +++ b/prefabs.json @@ -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 } + ] +} \ No newline at end of file