Skip to content

Commit

Permalink
Merge pull request #27 from den3606/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
den3606 authored Jul 10, 2022
2 parents ec7be4f + 89b1d2e commit 35cb028
Show file tree
Hide file tree
Showing 60 changed files with 651 additions and 175 deletions.
2 changes: 1 addition & 1 deletion files/audio/GUIDs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
{fd468381-c98d-41be-9be3-09b5d255ccad} event:/akanechan/player/buy/temple_products
{39fd5b19-b7ac-469e-8862-baf88373cd64} event:/akanechan/player/dead
{784a8eb4-d6d3-41cf-a997-8ecaa6251dab} event:/akanechan/player/kick
{94462a59-9dea-42a8-b738-9853069151b7} event:/akanechan/player/pickup/health
{c98a2fd1-09a6-47b7-a361-b8cad7764bde} event:/akanechan/player/pickup/refresher
{94462a59-9dea-42a8-b738-9853069151b7} event:/akanechan/player/pickup/temple_health
{5f3332d1-3750-45b2-9fd2-b64f5b2f3498} event:/akanechan/player/pickup/wand
{ce13fec0-e96a-40d6-aa44-4f57000ee4b2} event:/akanechan/player/spawn
{65674dc5-e109-4a98-9541-04bfb3df21f0} event:/akanechan/player/take_damage/heavy
Expand Down
Binary file modified files/audio/mod_voices.bank
Binary file not shown.
2 changes: 1 addition & 1 deletion files/entities/extend_heart_fullhp_temple_voices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
></AudioComponent>

<LuaComponent
script_item_picked_up="mods/akanechan_voice/files/scripts/player/pickup/health.lua" >
script_item_picked_up="mods/akanechan_voice/files/scripts/player/pickup/temple_health.lua" >
</LuaComponent>
</Entity>
55 changes: 8 additions & 47 deletions files/entities/extend_player_voices.xml
Original file line number Diff line number Diff line change
@@ -1,57 +1,18 @@
<Entity>
<AudioComponent
file="mods/akanechan_voice/files/audio/mod_voices.snd"
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
></AudioComponent>
<LuaComponent
execute_on_added="1"
set_latest_event_position="1"></AudioComponent>

<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
remove_after_executed="1"
script_source_file="mods/akanechan_voice/files/scripts/player/init_voices.lua" >
</LuaComponent>
script_source_file="mods/akanechan_voice/files/scripts/player/spawn.lua">
</LuaComponent>

<LuaComponent
script_damage_received="mods/akanechan_voice/files/scripts/player/damage_received.lua" >
<LuaComponent script_damage_received="mods/akanechan_voice/files/scripts/player/damage_received.lua">
</LuaComponent>

<LuaComponent
script_kick="mods/akanechan_voice/files/scripts/player/kick.lua">
<LuaComponent script_kick="mods/akanechan_voice/files/scripts/player/kick.lua">
</LuaComponent>
</Entity>
<!-- メモ -->
<!--
std::string script_source_file - ""
bool execute_on_added 0 [0, 1] ""
bool execute_on_removed 0 [0, 1] ""
int execute_every_n_frame 1 [1, 150] "1 = execute every frame. 2 = execute every second frame. 3 = execute every third frame and so on. -1 = execute only on add/remove/event"
int execute_times 0 [0, 1] "How many times should the script be executed? < 1 means infinite"
bool remove_after_executed 0 [0, 1] ""
bool enable_coroutines 0 [0, 1] ""
bool call_init_function 0 [0, 1] " if 1, calls function init( entity_id:int ) after running the code in the file scope of script_source_file along with all mod appends. Does nothing if execute_on_added is 0"
std::string script_enabled_changed - "if set, calls function 'enabled_changed( entity_id:int, is_enabled:bool )' when the IsEnabled status of this LuaComponent is changed"
std::string script_damage_received - "if set, calls function 'damage_received( damage:number, message:string, entity_thats_responsible:int, is_fatal:bool, projectile_thats_responsible:int )' when we receive a message about damage (Message_DamageReceived)"
std::string script_damage_about_to_be_received - "if set, calls function 'script_damage_about_to_be_received( damage:number, x:number, y:number, entity_thats_responsible:int, critical_hit_chance:int )' when we receive a message (Message_DamageAboutToBeReceived) -> new_damage:number,new_critical_hit_chance:int"
std::string script_item_picked_up - "if set, calls function 'item_pickup( int entity_item, int entity_pickupper, string item_name )' when message 'Message_ItemPickUp' is called"
std::string script_shot - "if set, calls function 'shot( projectile_entity_id )' when we receive Message_Shot"
std::string script_collision_trigger_hit - "if set, calls function 'collision_trigger( colliding_entity_id )' when we receive Message_CollisionTriggerHit"
std::string script_collision_trigger_timer_finished - "if set, calls function 'collision_trigger_timer_finished()' when we receive Message_CollisionTriggerTimerFinished"
std::string script_physics_body_modified - "if set, calls function 'physics_body_modified( is_destroyed )' when physics body has been modified"
std::string script_pressure_plate_change - "if set, calls function 'pressure_plate_change( new_state )' when PressurePlateComponent decides that things have change"
std::string script_inhaled_material - "if set, calls function 'inhaled_material( material_name, count )' once per second for each inhaled material"
std::string script_death - "if set, calls function 'death( int damage_type_bit_field, string damage_message, int entity_thats_responsible, bool drop_items )' when we receive message Message_Death"
std::string script_throw_item - "if set, calls function 'throw_item( from_x, from_y, to_x, to_y )' when we receive message Message_ThrowItem"
std::string script_material_area_checker_failed - "if set, calls function 'material_area_checker_failed( pos_x, pos_y, )' when we receive message Message_MaterialAreaCheckerFailed"
std::string script_material_area_checker_success - "if set, calls function 'material_area_checker_success( pos_x, pos_y, )' when we receive message Message_MaterialAreaCheckerSuccess"
std::string script_electricity_receiver_switched - "if set, calls function 'electricity_receiver_switched( bool is_electrified )' when we receive message Message_ElectricityReceiverSwitched"
std::string script_electricity_receiver_electrified - "if set, calls function 'electricity_receiver_electrified()' when we receive message Message_ElectricityReceiverElectrified"
std::string script_kick - "if set, calls function 'kick( entity_who_kicked )' when we receive message Message_Kick"
std::string script_interacting - "if set, calls function 'interacting( entity_who_interacted, entity_interacted, interactable_name )' when we receive message Message_Interaction"
std::string script_audio_event_dead - "if set, calls function 'audio_event_dead( bank_file, event_root )' when we receive message Message_AudioEventDead"
std::string script_wand_fired - "if set, calls function 'wand_fired( gun_entity_id )' when we receive Message_WandFired"
std::string script_teleported - "if set, calls function 'teleported( from_x, from_y, to_x, to_y, bool portal_teleport )' when we receive Message_Teleported"
std::string script_portal_teleport_used - "if set, calls function 'portal_teleport_used( entity_that_was_teleported, from_x, from_y, to_x, to_y )' when we receive Message_PortalTeleportUsed"
int mLastExecutionFrame -1 [0, 1] ""
bool mModAppendsDone 0 [0, 1] ""
-->
3 changes: 0 additions & 3 deletions files/entities/extend_wand_voices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@
<LuaComponent
script_item_picked_up="mods/akanechan_voice/files/scripts/player/pickup/wand.lua" >
</LuaComponent>
<LuaComponent
script_throw_item="mods/akanechan_voice/files/scripts/player/throw_wand.lua" >
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/damage_received/heavy_damage_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/damage_received/heavy_damage_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/damage_received/heavy_damage_voice.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/damage_received/low_helth_damage_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/damage_received/low_helth_damage_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/damage_received/low_helth_damage_voice.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/damage_received/mild_damage_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/damage_received/mild_damage_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/damage_received/mild_damage_voice.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/damage_received/on_fire_damage_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/damage_received/on_fire_damage_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/damage_received/on_fire_damage_voice.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/enemy/pickup/wand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/enemy/pickup/wand.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/enemy/pickup/wand.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/kick_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/kick_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/kick_voice.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/pickup/refresher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="refresher">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/pickup/refresher.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/pickup/refresher.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/pickup/shop_wand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/pickup/shop_wand.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/pickup/shop_wand.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/pickup/temple_health.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="refresher">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/pickup/temple_health.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/pickup/temple_health.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/pickup/wand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/pickup/wand.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/pickup/wand.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/start_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/start_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/start_voice.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/throw/emerald_tablet_voice copy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/throw/emerald_tablet_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/throw/emerald_tablet_voice.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/throw/item_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/throw/item_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/throw/item_voice.lua">
</LuaComponent>
</Entity>
15 changes: 15 additions & 0 deletions files/entities/sounds/throw/wand_voice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Entity name="start_voice">
<AudioComponent file="mods/akanechan_voice/files/audio/mod_voices.snd"
event_root="akanechan"
audio_physics_material="character_player"
set_latest_event_position="1"
remove_latest_event_on_destroyed="1"
send_message_on_event_dead="1"
>
</AudioComponent>
<LuaComponent execute_on_added="1"
execute_every_n_frame="-1"
script_source_file="mods/akanechan_voice/files/scripts/sounds/throw/wand_voice.lua"
script_audio_event_dead="mods/akanechan_voice/files/scripts/sounds/throw/wand_voice.lua">
</LuaComponent>
</Entity>
26 changes: 21 additions & 5 deletions files/scripts/lib/utilities.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
function p(message)
print(tostring(message))
end

function split(str, sep)
if sep == nil then
return {}
end

local t = {}

local i = 1
for s in string.gmatch(str, "([^" .. sep .. "]+)") do
t[i] = s
i = i + 1
end

return t
end

dofile_once("mods/akanechan_voice/files/scripts/lib/utils/global_values.lua")
dofile_once("mods/akanechan_voice/files/scripts/lib/utils/variable_storage.lua")
dofile_once("mods/akanechan_voice/files/scripts/lib/utils/player.lua")
dofile_once("mods/akanechan_voice/files/scripts/lib/utils/calculate.lua")

-- has dependent
dofile_once("mods/akanechan_voice/files/scripts/lib/utils/wait_frame.lua")


function p(message)
print(tostring(message))
end
dofile_once("mods/akanechan_voice/files/scripts/lib/utils/sound_player.lua")
Loading

0 comments on commit 35cb028

Please sign in to comment.