Decoupled the songs from the players. This enables external songs to interface with the mod.

master
Jaka Perovšek 2021-11-28 04:09:19 +01:00
parent 02d25f8cd9
commit ee7adf0f63
1 changed files with 58 additions and 79 deletions

View File

@ -23,38 +23,18 @@
<StatusEffect type="OnUse" targettype="This" IsOn="true">
<Conditional IsOn="false" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
</StatusEffect>
<!--StatusEffect type="OnUse" targettype="Contained" comparison="And">
<Conditional condition="lte 50.0" />
<Conditional condition="gt 25.0" />
<RequiredItem items="cassette" type="Contained" />
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
<SpawnItem identifiers="song-control-play" spawnposition="ContainedInventory" />
</StatusEffect>
<StatusEffect type="OnUse" targettype="Contained" comparison="And">
<Conditional condition="lte 25.0" />
<Conditional condition="gt 10.0" />
<RequiredItem items="cassette" type="Contained" />
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
</StatusEffect>
<StatusEffect type="OnUse" targettype="Contained">
<Conditional condition="lte 10.0" />
<RequiredItem items="cassette" type="Contained" />
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
</StatusEffect-->
{% for tape in tapes %}
<StatusEffect type="OnUse" targettype="Contained" condition="-{{ condition_delta[loop.index0] }}">
<RequiredItem items="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}cassette-{{ tape.identifier }}" type="Contained" />
<SpawnItem identifiers="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}song-{{ tape.identifier }}" spawnposition="ContainedInventory" />
</StatusEffect>{% endfor %}
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
<Conditional IsOn="true" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
<RequiredItem items="cassette" type="Contained" />
<Use />
</StatusEffect>
</TickBox>
</CustomInterface>
<Holdable slots="RightHand,LeftHand" selectkey="Use" pickkey="Select" attachable="false" aimable="false" holdpos="5,-65" holdangle="0" aimpos="5,30" handle1="0,30" handle2="0,30" swingamount="25,7" swingspeed="0.5" swingwhenusing="true" msg="ItemMsgPickUpUse">
<Holdable slots="RightHand,LeftHand" selectkey="Select" pickkey="Use" attachable="false" aimable="false" holdpos="5,-65" holdangle="0" aimpos="5,30" handle1="0,30" handle2="0,30" swingamount="25,7" swingspeed="0.5" swingwhenusing="true" msg="ItemMsgPickUpUse">
</Holdable>
<ItemContainer hideitems="true" drawinventory="true" capacity="1" maxstacksize="1" slotsperrow="6" itempos="0,0" iteminterval="0,0" itemrotation="0" canbeselected="false" containedspritedepth="0.79">
<StatusEffect type="OnUse" targettype="Contained" >
@ -87,34 +67,14 @@
<StatusEffect type="OnUse" targettype="This" IsOn="true">
<Conditional IsOn="false" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
</StatusEffect>
<!--StatusEffect type="OnUse" targettype="Contained" comparison="And">
<Conditional condition="lte 50.0" />
<Conditional condition="gt 25.0" />
<RequiredItem items="cassette" type="Contained" />
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
<SpawnItem identifiers="song-control-play" spawnposition="ContainedInventory" />
</StatusEffect>
<StatusEffect type="OnUse" targettype="Contained" comparison="And">
<Conditional condition="lte 25.0" />
<Conditional condition="gt 10.0" />
<RequiredItem items="cassette" type="Contained" />
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
</StatusEffect>
<StatusEffect type="OnUse" targettype="Contained">
<Conditional condition="lte 10.0" />
<RequiredItem items="cassette" type="Contained" />
<sound file="Content/Sounds/FireSmall.ogg" type="OnUse" range="1000" loop="true" volume="1.0" />
</StatusEffect-->
{% for tape in tapes %}
<StatusEffect type="OnUse" targettype="Contained" condition="-{{ condition_delta[loop.index0] }}">
<RequiredItem items="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}cassette-{{ tape.identifier }}" type="Contained" />
<SpawnItem identifiers="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}song-walkman-{{ tape.identifier }}" spawnposition="ContainedInventory" />
</StatusEffect>{% endfor %}
<StatusEffect type="OnSecondaryUse" targettype="This" IsOn="false" >
<Conditional IsOn="true" />
<sound file="Mods/{{ config['name'] }}/sound_effects/boombox_play_cassette.ogg" type="OnUse" range="500" volume="1.0" />
<Use />
<RequiredItem items="cassette" type="Contained" />
<SpawnItem identifiers="song-control-stop" spawnposition="ContainedInventory" />
</StatusEffect>
</TickBox>
</CustomInterface>
@ -129,39 +89,17 @@
</ItemContainer>
</Item>
<!-- tape box -->
<!-- SONGS CONTROL -->
<Item name="Cassette Tape Box" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}cassette-tape-box" category="Equipment" tags="smallitem,mobilecontainer,tool" cargocontaineridentifier="" showcontentsintooltip="true" Scale="0.5" fireproof="true" description="" impactsoundtag="impact_metal_heavy">
<PreferredContainer secondary="wreckstoragecab" spawnprobability="0.06"/>
<PreferredContainer primary="outpostcrewcabinet" minamount="0" maxamount="1" spawnprobability="0.2"/>
<Deconstruct time="10">
<Item identifier="steel" />
</Deconstruct>
<Fabricate suitablefabricators="fabricator" requiredtime="20">
<RequiredSkill identifier="mechanical" level="20" />
<Item identifier="steel" />
</Fabricate>
<Price baseprice="75" >
<Price locationtype="outpost" multiplier="1" minavailable="1" />
<Price locationtype="city" multiplier="0.9" minavailable="1" />
<Price locationtype="research" multiplier="1.25" minavailable="1" />
<Price locationtype="military" multiplier="1.25" minavailable="1" />
<Price locationtype="mine" multiplier="1.25" minavailable="1" />
</Price>
<InventoryIcon texture="Content/Items/InventoryIconAtlas.png" sourcerect="640,256,64,64" origin="0.5,0.6" />
<Sprite texture="Content/Items/Tools/tools.png" sourcerect="314,1,94,74" origin="0.5,0.5" />
<Body width="90" height="60" density="20" />
<MeleeWeapon slots="RightHand,LeftHand,Any" controlpose="true" aimpos="45,10" handle1="0,10" handle2="0,10" holdangle="90" reload="1" range="50" combatpriority="6" msg="ItemMsgPickUpSelect">
<Attack structuredamage="10" itemdamage="5" stun="0.6" targetimpulse="2">
<Affliction identifier="blunttrauma" strength="2" />
<Sound file="Content/Items/Weapons/Smack2.ogg" range="800" />
</Attack>
</MeleeWeapon>
<ItemContainer capacity="24" keepopenwhenequipped="true" movableframe="true">
<Containable items="cassette" />
</ItemContainer>
<aitarget sightrange="1000" soundrange="1000" fadeouttime="2" />
<Upgrade gameversion="0.10.0.0" scale="0.5" />
<Item name="Song Control Play" identifier="song-control-play" Tags="song-control-play" category="Misc">
<Sprite texture="Content/Items/Electricity/signalcomp.png" depth="0.8" sourcerect="0,160,4,4" origin="0.5,0.5" />
<Body width="48" height="48" />
<InventoryIcon texture="Content/Items/Electricity/signalcomp.png" sourcerect="0,160,4,4" origin="0.5,0.5" />
<ItemComponent>
<StatusEffect type="OnContained" targettype="This">
<Remove />
</StatusEffect>
</ItemComponent>
</Item>
<!-- Cassette Tapes -->
@ -184,7 +122,7 @@
<CustomInterface canbeselected="false" drawhudwhenequipped="true" allowuioverlap="true">
<GuiFrame relativesize="{{ 512.0 / config['resolution_x'] }},{{ 328.0 / config['resolution_y'] }}" anchor="CenterRight" pivot="CenterRight" style="{{ config['slug'] }}_cover_{{ tape.identifier }}" />
</CustomInterface>
<ItemContainer hideitems="true" capacity="1" drawinventory="false" canbeselected="false" canbecombined="true" removecontaineditemsondeconstruct="true">
<ItemContainer hideitems="true" capacity="2" drawinventory="false" canbeselected="false" canbecombined="true" removecontaineditemsondeconstruct="true">
<StatusEffect type="OnNotContained" targettype="Contained">
<Use />
</StatusEffect>
@ -196,6 +134,11 @@
<Use />
</StatusEffect>
<Containable items="song" />
<Containable items="song-control-play">
<StatusEffect type="OnContaining" targettype="This">
<SpawnItem identifiers="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}song-{{ tape.identifier }}" spawnposition="ThisInventory" />
</StatusEffect>
</Containable>
</ItemContainer>
<Holdable slots="Any,RightHand,LeftHand" msg="ItemMsgPickUpSelect" >
<StatusEffect type="OnBroken" target="This">
@ -251,4 +194,40 @@
{% endfor %}
<!-- tape box -->
<Item name="Cassette Tape Box" identifier="{% if config['slug'] != "sunken_tapes" %}{{ config["slug"] }}-{% endif %}cassette-tape-box" category="Equipment" tags="smallitem,mobilecontainer,tool" cargocontaineridentifier="" showcontentsintooltip="true" Scale="0.5" fireproof="true" description="" impactsoundtag="impact_metal_heavy">
<PreferredContainer secondary="wreckstoragecab" spawnprobability="0.06"/>
<PreferredContainer primary="outpostcrewcabinet" minamount="0" maxamount="1" spawnprobability="0.2"/>
<Deconstruct time="10">
<Item identifier="steel" />
</Deconstruct>
<Fabricate suitablefabricators="fabricator" requiredtime="20">
<RequiredSkill identifier="mechanical" level="20" />
<Item identifier="steel" />
</Fabricate>
<Price baseprice="75" >
<Price locationtype="outpost" multiplier="1" minavailable="1" />
<Price locationtype="city" multiplier="0.9" minavailable="1" />
<Price locationtype="research" multiplier="1.25" minavailable="1" />
<Price locationtype="military" multiplier="1.25" minavailable="1" />
<Price locationtype="mine" multiplier="1.25" minavailable="1" />
</Price>
<InventoryIcon texture="Content/Items/InventoryIconAtlas.png" sourcerect="640,256,64,64" origin="0.5,0.6" />
<Sprite texture="Content/Items/Tools/tools.png" sourcerect="314,1,94,74" origin="0.5,0.5" />
<Body width="90" height="60" density="20" />
<MeleeWeapon slots="RightHand,LeftHand,Any" controlpose="true" aimpos="45,10" handle1="0,10" handle2="0,10" holdangle="90" reload="1" range="50" combatpriority="6" msg="ItemMsgPickUpSelect">
<Attack structuredamage="10" itemdamage="5" stun="0.6" targetimpulse="2">
<Affliction identifier="blunttrauma" strength="2" />
<Sound file="Content/Items/Weapons/Smack2.ogg" range="800" />
</Attack>
</MeleeWeapon>
<ItemContainer capacity="24" keepopenwhenequipped="true" movableframe="true">
<Containable items="cassette" />
</ItemContainer>
<aitarget sightrange="1000" soundrange="1000" fadeouttime="2" />
<Upgrade gameversion="0.10.0.0" scale="0.5" />
</Item>
</Items>