Skip to content

Commit 1d39d9a

Browse files
author
den3606
committed
feat: gallery_punchを実装した
1 parent c3a5777 commit 1d39d9a

File tree

5 files changed

+108
-11
lines changed

5 files changed

+108
-11
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<Entity name="$projectile_default"
2+
tags="projectile_player">
3+
4+
<Base file="data/entities/base_projectile.xml">
5+
<VelocityComponent air_friction="-0.4"
6+
mass="0.65">
7+
</VelocityComponent>
8+
</Base>
9+
10+
<ProjectileComponent _enabled="1"
11+
lob_min="0.8"
12+
lob_max="1.1"
13+
speed_min="10000"
14+
speed_max="10000"
15+
direction_random_rad="0.003"
16+
on_death_explode="1"
17+
on_death_gfx_leave_sprite="0"
18+
on_lifetime_out_explode="1"
19+
die_on_low_velocity="1"
20+
explosion_dont_damage_shooter="1"
21+
on_collision_die="1"
22+
ragdoll_force_multiplier="0.03"
23+
lifetime="300"
24+
ground_penetration_coeff="6"
25+
velocity_sets_scale="1"
26+
camera_shake_when_shot="0"
27+
shoot_light_flash_radius="0"
28+
hit_particle_force_multiplier="0.1"
29+
create_shell_casing="0"
30+
bounces_left="0"
31+
collide_with_shooter_frames="0"
32+
friendly_fire="1"
33+
damage="0.04"
34+
muzzle_flash_file=""
35+
knockback_force="0.7">
36+
<config_explosion never_cache="1"
37+
damage="0"
38+
camera_shake="0"
39+
explosion_radius="0.5"
40+
explosion_sprite="data/particles/explosion_016_plasma.xml"
41+
explosion_sprite_lifetime="0"
42+
create_cell_probability="0"
43+
hole_destroy_liquid="0"
44+
hole_enabled="1"
45+
hole_image="data/temp/explosion_hole.png"
46+
explosion_sprite_additive="1"
47+
ray_energy="0"
48+
particle_effect="0"
49+
physics_explosion_power.min="0"
50+
physics_explosion_power.max="0"
51+
physics_throw_enabled="0"
52+
shake_vegetation="1"
53+
sparks_count_min="0"
54+
sparks_count_max="0"
55+
sparks_enabled="0"
56+
light_enabled="0"
57+
stains_enabled="1"
58+
stains_radius="1">
59+
</config_explosion>
60+
</ProjectileComponent>
61+
62+
<AudioComponent
63+
file="data/audio/Desktop/projectiles.bank"
64+
event_root="player_projectiles/bomb">
65+
</AudioComponent>
66+
67+
<AudioLoopComponent
68+
file="data/audio/Desktop/projectiles.bank"
69+
event_name="projectiles/fuse_burn_slow"
70+
auto_play="1">
71+
</AudioLoopComponent>
72+
73+
</Entity>
74+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
local function GralleryPunch(data, event)
2+
local EventHelper = dofile_once("mods/twitch-point-integration/files/scripts/event_helper.lua")
3+
4+
local player_entity_id = GetPlayerEntity()
5+
if player_entity_id == nil then
6+
return false
7+
end
8+
9+
local x, y = EntityGetTransform(GetPlayerEntity())
10+
SetRandomSeed(x + GameGetFrameNum(), y + GameGetFrameNum())
11+
local direction = ({-1, 1})[Random(1, 2)]
12+
EventHelper.ShootProjectile(GetPlayerEntity(), "mods/twitch-point-integration/files/entities/projectiles/gallery_punch.xml", x, y, direction * 300, -200)
13+
return true
14+
end
15+
16+
return GralleryPunch

files/scripts/noita_event_observer.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ local events = {
3737
twitchCost = 800,
3838
weight = 100,
3939
},
40+
GralleryPunch = {
41+
action = dofile_once("mods/twitch-point-integration/files/scripts/events/gallery_punch.lua"),
42+
name = "GralleryPunch",
43+
twitchCost = 20,
44+
weight = 100,
45+
},
4046
Healing = {
4147
action = dofile_once("mods/twitch-point-integration/files/scripts/events/healing.lua"),
4248
name = "Healing",

files/scripts/status_effects/bomberman.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ if (player_entity_id == nil) then
77
end
88

99
local x, y = EntityGetTransform(player_entity_id)
10-
local entity_id = EntityLoad( "mods/twitch-point-integration/files/entities/bomberman.xml", x, y )
10+
local entity_id = EntityLoad("mods/twitch-point-integration/files/entities/bomberman.xml", x, y)
1111

12-
edit_component( entity_id, "ProjectileComponent", function(comp,vars)
13-
local herd_id = get_herd_id( player_entity_id )
14-
vars.mWhoShot = player_entity_id
15-
vars.mShooterHerdId = herd_id
16-
end)
17-
edit_component( entity_id, "VelocityComponent", function(comp,vars)
18-
ComponentSetValueVector2( comp, "mVelocity", 0, 0 )
19-
end)
20-
GameShootProjectile( player_entity_id, x, y, x, y, entity_id, true )
12+
edit_component(entity_id, "ProjectileComponent", function(comp, vars)
13+
local herd_id = get_herd_id(player_entity_id)
14+
vars.mWhoShot = player_entity_id
15+
vars.mShooterHerdId = herd_id
16+
end)
17+
edit_component(entity_id, "VelocityComponent", function(comp, vars)
18+
ComponentSetValueVector2(comp, "mVelocity", 0, 0)
19+
end)
20+
GameShootProjectile(player_entity_id, x, y, x, y, entity_id, true)

init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ local function noita_event_debug()
6666
-- Lume.push(NOITA_TASKS, {event_name = "Blindness", event_data = { used_by = 'noita', message = 'testMessage' }})
6767
-- Lume.push(NOITA_TASKS, {event_name = "Bomberman", event_data = { used_by = 'noita', message = 'testMessage' }})
6868
-- Lume.push(NOITA_TASKS, {event_name = "FungalShift", event_data = { used_by = 'noita', message = 'testMessage' }})
69+
Lume.push(NOITA_TASKS, {event_name = "GralleryPunch", event_data = { used_by = 'noita', message = 'testMessage' }})
6970
-- Lume.push(NOITA_TASKS, {event_name = "Healing", event_data = { used_by = 'noita', message = 'testMessage' }})
7071
-- Lume.push(NOITA_TASKS, {event_name = "HeavySpread", event_data = { used_by = 'noita', message = 'testMessage' }})
7172
-- Lume.push(NOITA_TASKS, {event_name = "HelloDeer", event_data = { used_by = 'noita', message = 'testMessage' }})
@@ -101,7 +102,7 @@ local function noita_event_debug()
101102
end
102103

103104
-- Coil.add(function() Coil.wait(180) add_events() end) -- once
104-
-- Coil.add(function() while true do Coil.wait(180) add_events() end end) -- Loop
105+
Coil.add(function() while true do Coil.wait(180) add_events() end end) -- Loop
105106
end
106107

107108
function OnPlayerSpawned(player_entity_id)

0 commit comments

Comments
 (0)