add lukki sprite back, have map respect player colors, try to make colors more reliable, dont send adventure perk to peers

This commit is contained in:
bgkillas 2024-11-23 23:38:56 -05:00
parent e673eb9930
commit 594af87651
14 changed files with 713 additions and 31 deletions

View file

@ -20,6 +20,7 @@ local perks_to_ignore = {
TELEKINESIS = true,
HEARTS_MORE_EXTRA_HP = true,
MAP = true,
ADVENTURER = true,
}
local global_perks = {

View file

@ -310,7 +310,9 @@ local function send_item_positions(all)
if is_my_item(gid) and is_item_on_ground(item) then
local phys_info = util.get_phys_info(item, true)
local x, y = EntityGetTransform(item)
if (phys_info[1][1] ~= nil or phys_info[2][1] ~= nil or all)
if ((phys_info[1] ~= nil and phys_info[1][1] ~= nil)
or (phys_info[2] ~= nil and phys_info[2][1] ~= nil)
or all)
and (#EntityGetInRadiusWithTag(x, y, DISTANCE_LIMIT, "ew_peer") ~= 0
or #EntityGetInRadiusWithTag(x, y, DISTANCE_LIMIT, "polymorphed_player") ~= 0) then
local costcom = EntityGetFirstComponentIncludingDisabled(item, "ItemCostComponent")

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -3,21 +3,26 @@ dofile_once("data/scripts/lib/utilities.lua")
ModLuaFileAppend("data/scripts/perks/map.lua", "mods/quant.ew/files/system/map/append.lua")
util.add_cross_call("ew_place_player_on_map", function()
local my_x, my_y = EntityGetTransform(ctx.my_player.entity)
local my_pw = check_parallel_pos(my_x)
for peer_id, data in pairs(ctx.players) do
local x, y = EntityGetTransform(data.entity)
y = y - 4
local _, mx = check_parallel_pos( x )
local map_x = 0 * 512
local map_y = 10 * 512
local pw, mx = check_parallel_pos( x )
if pw == my_pw then
local map_x = 0 * 512
local map_y = 10 * 512
local mult_x = 512 / 6.0
local mult_y = 512 / 6.0
local mult_x = 512 / 6.0
local mult_y = 512 / 6.0
local dx = math.min( math.max( ( map_x - mx ) / mult_x, -420), 420 )
local dy = math.min( math.max( ( map_y - y ) / mult_y, -240), 240 )
local pi_x = x - dx * 0.5
local pi_y = y - dy * 0.5
GameCreateSpriteForXFrames("data/particles/spatial_map_player.png", pi_x, pi_y, true, 0, 0, 1, true)
local dx = math.min( math.max( ( map_x - mx ) / mult_x, -420), 420 )
local dy = math.min( math.max( ( map_y - y ) / mult_y, -240), 240 )
local pi_x = my_x - dx * 0.5
local pi_y = my_y - dy * 0.5
GameCreateSpriteForXFrames("mods/quant.ew/files/system/player/tmp/" .. peer_id .. "_map.png",
pi_x, pi_y, true, 0, 0, 1, true)
end
end
end)

View file

@ -98,13 +98,13 @@ function add_lukkiness_level(entity_who_picked)
GlobalsSetValue( "PLAYER_LUKKINESS_LEVEL", tostring( lochness ) )
if ( lochness == 3 ) then
--EntitySetComponentsWithTagEnabled( entity_who_picked, "lukki_enable", true )
EntitySetComponentsWithTagEnabled( entity_who_picked, "lukki_enable", true )
AddFlagPersistent( "player_status_lukky" )
--local comp = EntityGetFirstComponent( entity_who_picked, "SpriteComponent", "lukki_disable" )
--if ( comp ~= nil ) then
-- ComponentSetValue2( comp, "alpha", 0.0 )
--end
local comp = EntityGetFirstComponent( entity_who_picked, "SpriteComponent", "lukki_disable" )
if ( comp ~= nil ) then
ComponentSetValue2( comp, "alpha", 0.0 )
end
local platformingcomponents = EntityGetComponent( entity_who_picked, "CharacterPlatformingComponent" )
if( platformingcomponents ~= nil ) then

View file

@ -101,6 +101,11 @@ local function become_fungus(entity_who_picked)
end
local function become_luuki(entity_who_picked)
EntitySetComponentsWithTagEnabled( entity_who_picked, "lukki_enable", true )
local comp = EntityGetFirstComponent( entity_who_picked, "SpriteComponent", "lukki_disable" )
if ( comp ~= nil ) then
ComponentSetValue2( comp, "alpha", 0.0 )
end
local platformingcomponents = EntityGetComponent( entity_who_picked, "CharacterPlatformingComponent" )
if( platformingcomponents ~= nil ) then
for i,component in ipairs(platformingcomponents) do

View file

@ -20,12 +20,15 @@ function player_color(player_entity)
end
local player_sprite_component = EntityGetFirstComponent( player_entity, "SpriteComponent" )
local player_sprite_component_lukki = EntityGetFirstComponent( player_entity, "SpriteComponent", "lukki_enable" )
local player_sprite_file = "mods/quant.ew/files/system/player/tmp/" .. ctx.my_id .. ".xml"
local player_sprite_file_lukki = "mods/quant.ew/files/system/player/tmp/" .. ctx.my_id .. ".xml"
local player_arm_sprite_component = EntityGetFirstComponent( player_arm, "SpriteComponent" )
if player_sprite_component == nil or player_arm_sprite_component == nil then
return
end
ComponentSetValue( player_sprite_component, "image_file", player_sprite_file )
ComponentSetValue( player_sprite_component_lukki, "image_file", player_sprite_file_lukki )
local player_arm_sprite_file = "mods/quant.ew/files/system/player/tmp/" .. ctx.my_id .. "_arm.xml"
ComponentSetValue( player_arm_sprite_component, "image_file", player_arm_sprite_file )

View file

@ -213,7 +213,7 @@
_tags="character,lukki_enable"
_enabled="0"
alpha="1"
image_file="data/enemies_gfx/player_lukky.xml"
image_file="MARKER_LUKKI_SPRITE"
next_rect_animation=""
offset_x="6"
offset_y="14"
@ -616,4 +616,4 @@
></SpriteComponent>
</Entity>
<Entity name="inventory_quick">
</Entity>
</Entity>

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -0,0 +1,604 @@
<Sprite
default_animation="stand"
filename="MARKER_LUKKI_PNG"
offset_x="6"
offset_y="14" >
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.2"
frame_width="12"
frames_per_row="8"
name="stand"
pos_x="0"
pos_y="1" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.105"
frame_width="12"
frames_per_row="8"
name="walk"
pos_x="0"
pos_y="21" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.105"
frame_width="12"
frames_per_row="8"
name="run"
pos_x="0"
pos_y="21" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.095"
frame_width="12"
frames_per_row="8"
name="burn"
pos_x="0"
pos_y="21" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.082"
frame_width="12"
frames_per_row="8"
loop="0"
name="jump_up"
pos_x="0"
pos_y="41" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.082"
frame_width="12"
frames_per_row="8"
loop="0"
name="jump_fall"
pos_x="0"
pos_y="61" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.075"
frame_width="12"
frames_per_row="8"
loop="0"
name="land"
pos_x="0"
pos_y="81" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="19"
frame_wait="0.09"
frame_width="12"
frames_per_row="8"
name="fly_idle"
pos_x="0"
pos_y="101" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="20"
frame_wait="0.12"
frame_width="13"
frames_per_row="8"
name="fly_move"
pos_x="0"
pos_y="121"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="20"
frame_wait="0.06"
frame_width="13"
frames_per_row="8"
name="knockback"
pos_x="0"
pos_y="141"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="20"
frame_wait="0.08"
frame_width="13"
frames_per_row="8"
name="swim_idle"
pos_x="0"
pos_y="161"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="5"
frame_height="20"
frame_wait="0.11"
frame_width="13"
frames_per_row="8"
name="swim_move"
pos_x="0"
pos_y="181"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="20"
frame_wait="0.11"
frame_width="13"
frames_per_row="8"
loop="0"
name="attack"
pos_x="0"
pos_y="201"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="20"
frame_wait="0.11"
frame_width="13"
frames_per_row="8"
loop="0"
name="kick"
pos_x="0"
pos_y="201"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="20"
frame_wait="0.06"
frame_width="13"
frames_per_row="8"
loop="0"
name="telekinesis_throw"
pos_x="26"
pos_y="201"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="20"
frame_wait="0.11"
frame_width="13"
frames_per_row="8"
loop="0"
name="kick_alt"
pos_x="0"
pos_y="221"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.05"
frame_width="12"
frames_per_row="8"
loop="0"
name="lower_head"
pos_x="0"
pos_y="241" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.05"
frame_width="12"
frames_per_row="8"
loop="0"
name="raise_head"
pos_x="0"
pos_y="261" >
</RectAnimation>
<RectAnimation
frame_count="11"
frame_height="19"
frame_wait="0.07"
frame_width="12"
frames_per_row="11"
name="eat"
pos_x="0"
pos_y="281" >
</RectAnimation>
<RectAnimation
frame_count="1"
frame_height="19"
frame_wait="0.14"
frame_width="12"
frames_per_row="8"
name="crouch"
pos_x="0"
pos_y="281" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.105"
frame_width="12"
frames_per_row="8"
name="walk_backwards"
pos_x="0"
pos_y="301" >
</RectAnimation>
<RectAnimation
frame_count="5"
frame_height="19"
frame_wait="0.07"
frame_width="12"
frames_per_row="8"
loop="0"
name="move_item_stash"
pos_x="0"
pos_y="321" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="19"
frame_wait="0.09"
frame_width="12"
frames_per_row="8"
loop="0"
name="move_item"
pos_x="0"
pos_y="341" >
</RectAnimation>
<RectAnimation
frame_count="5"
frame_height="20"
frame_wait="0.09"
frame_width="13"
frames_per_row="8"
loop="0"
name="throw_old"
pos_x="0"
pos_y="361"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.2"
frame_width="12"
frames_per_row="8"
name="stand_crouched"
pos_x="0"
pos_y="381" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.095"
frame_width="12"
frames_per_row="8"
name="walk_crouched"
pos_x="0"
pos_y="401" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.095"
frame_width="12"
frames_per_row="8"
name="run_crouched"
pos_x="0"
pos_y="401" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.095"
frame_width="12"
frames_per_row="8"
name="walk_backwards_crouched"
pos_x="0"
pos_y="421" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="20"
frame_wait="0.06"
frame_width="13"
frames_per_row="8"
loop="0"
name="telekinesis_throw_crouched"
pos_x="26"
pos_y="441"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="20"
frame_wait="0.11"
frame_width="13"
frames_per_row="8"
loop="0"
name="kick_crouched"
pos_x="0"
pos_y="441"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="20"
frame_wait="0.11"
frame_width="13"
frames_per_row="8"
loop="0"
name="kick_alt_crouched"
pos_x="0"
pos_y="461"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="5"
frame_height="20"
frame_wait="0.09"
frame_width="13"
frames_per_row="8"
loop="0"
name="throw_crouched"
pos_x="0"
pos_y="481"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="5"
frame_height="20"
frame_wait="0.11"
frame_width="13"
frames_per_row="8"
loop="0"
name="rise"
pos_x="0"
pos_y="501"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="5"
frame_height="20"
frame_wait="0.07"
frame_width="13"
frames_per_row="8"
loop="0"
name="throw"
pos_x="0"
pos_y="521"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="19"
frame_wait="0.08"
frame_width="12"
frames_per_row="8"
name="slide"
pos_x="0"
pos_y="541" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.06"
frame_width="12"
frames_per_row="8"
loop="0"
name="slide_end"
pos_x="0"
pos_y="561" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="19"
frame_wait="0.08"
frame_width="12"
frames_per_row="8"
name="slide_crouched"
pos_x="0"
pos_y="581" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.06"
frame_width="12"
frames_per_row="8"
loop="0"
name="slide_end_crouched"
pos_x="0"
pos_y="601" >
</RectAnimation>
<RectAnimation
frame_count="2"
frame_height="19"
frame_wait="0.05"
frame_width="12"
frames_per_row="8"
loop="0"
name="slide_start"
pos_x="0"
pos_y="621" >
</RectAnimation>
<RectAnimation
frame_count="2"
frame_height="19"
frame_wait="0.05"
frame_width="12"
frames_per_row="8"
loop="0"
name="slide_start_crouched"
pos_x="0"
pos_y="641" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="20"
frame_wait="0.08"
frame_width="13"
frames_per_row="8"
loop="0"
name="hurt"
pos_x="0"
pos_y="661"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.08"
frame_width="12"
frames_per_row="8"
loop="0"
name="hurt_swim"
pos_x="0"
pos_y="681" >
</RectAnimation>
<RectAnimation
frame_count="3"
frame_height="19"
frame_wait="0.08"
frame_width="12"
frames_per_row="8"
loop="0"
name="hurt_fly"
pos_x="0"
pos_y="681" >
</RectAnimation>
<RectAnimation
frame_count="9"
frame_height="19"
frame_wait="0.1"
frame_width="12"
frames_per_row="9"
loop="0"
name="grab_item"
pos_x="0"
pos_y="701" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.24"
frame_width="12"
frames_per_row="8"
name="idle_hold"
pos_x="0"
pos_y="721" >
</RectAnimation>
<RectAnimation
frame_count="10"
frame_height="20"
frame_wait="0.07"
frame_width="13"
frames_per_row="10"
loop="0"
name="throw_item"
pos_x="0"
pos_y="741"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="19"
frame_wait="0.09"
frame_width="12"
frames_per_row="8"
loop="0"
name="push_start"
pos_x="0"
pos_y="761" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.12"
frame_width="12"
frames_per_row="8"
name="push"
pos_x="0"
pos_y="781" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.09"
frame_width="12"
frames_per_row="8"
loop="0"
name="cough"
pos_x="0"
pos_y="801" >
</RectAnimation>
<RectAnimation
frame_count="4"
frame_height="20"
frame_wait="0.08"
frame_width="13"
frames_per_row="8"
loop="0"
name="throw_small"
pos_x="0"
pos_y="821"
shrink_by_one_pixel="1" >
</RectAnimation>
<RectAnimation
frame_count="21"
frame_height="22"
frame_wait="0.15"
frame_width="20"
frames_per_row="21"
has_offset="1"
loop="0"
name="intro_stand_up"
next_animation="stand"
offset_x="10"
offset_y="14"
pos_x="0"
pos_y="841" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="22"
frame_wait="0.15"
frame_width="20"
frames_per_row="8"
has_offset="1"
name="intro_sleep"
offset_x="10"
offset_y="14"
pos_x="0"
pos_y="864" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.06"
frame_width="15"
frames_per_row="12"
loop="0"
name="telekinesis_grab_start"
pos_x="0"
pos_y="887" >
</RectAnimation>
<RectAnimation
frame_count="6"
frame_height="19"
frame_wait="0.06"
frame_width="15"
frames_per_row="12"
loop="0"
name="telekinesis_grab_start_crouched"
pos_x="0"
pos_y="907" >
</RectAnimation>
</Sprite>