mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
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:
parent
e673eb9930
commit
594af87651
14 changed files with 713 additions and 31 deletions
|
@ -353,7 +353,7 @@ impl NetManager {
|
|||
&self.init_settings.mod_path,
|
||||
&self.init_settings.player_path,
|
||||
&PlayerPngDesc::default(),
|
||||
self.is_host(),
|
||||
id == self.peer.host_id(),
|
||||
);
|
||||
info!("Sending PlayerColor to {id}");
|
||||
self.send(
|
||||
|
@ -361,6 +361,7 @@ impl NetManager {
|
|||
&NetMsg::PlayerColor(
|
||||
self.init_settings.player_png_desc,
|
||||
self.is_host(),
|
||||
Some(self.peer.my_id())
|
||||
),
|
||||
Reliability::Reliable,
|
||||
);
|
||||
|
@ -405,7 +406,7 @@ impl NetManager {
|
|||
}
|
||||
}
|
||||
NetMsg::WorldMessage(msg) => state.world.handle_msg(src, msg),
|
||||
NetMsg::PlayerColor(rgb, host) => {
|
||||
NetMsg::PlayerColor(rgb, host, pong) => {
|
||||
info!("Player appearance created for {}", src);
|
||||
// Create proper appearance files for new player.
|
||||
create_player_png(
|
||||
|
@ -415,6 +416,17 @@ impl NetManager {
|
|||
&rgb,
|
||||
host,
|
||||
);
|
||||
if let Some(id) = pong {
|
||||
self.send(
|
||||
id,
|
||||
&NetMsg::PlayerColor(
|
||||
self.init_settings.player_png_desc,
|
||||
self.is_host(),
|
||||
None
|
||||
),
|
||||
Reliability::Reliable,
|
||||
);
|
||||
}
|
||||
}
|
||||
NetMsg::Kick => std::process::exit(0),
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ pub(crate) enum NetMsg {
|
|||
ModRaw { data: Vec<u8> },
|
||||
ModCompressed { data: Vec<u8> },
|
||||
WorldMessage(WorldNetMessage),
|
||||
PlayerColor(PlayerPngDesc, bool),
|
||||
PlayerColor(PlayerPngDesc, bool, Option<OmniPeerId>),
|
||||
}
|
||||
|
||||
impl From<MessageRequest<WorldNetMessage>> for MessageRequest<NetMsg> {
|
||||
|
|
|
@ -5,7 +5,7 @@ use bitcode::{Decode, Encode};
|
|||
use eframe::egui;
|
||||
use eframe::egui::color_picker::{color_picker_color32, Alpha};
|
||||
use eframe::egui::{Color32, TextureHandle, TextureOptions, Ui};
|
||||
use image::{Rgba, RgbaImage};
|
||||
use image::{Pixel, Rgba, RgbaImage};
|
||||
use std::ffi::OsString;
|
||||
use std::fs::{self, File};
|
||||
use std::io::Write;
|
||||
|
@ -16,7 +16,7 @@ pub fn player_path(path: PathBuf) -> PathBuf {
|
|||
path.join("files/system/player/unmodified.png")
|
||||
}
|
||||
|
||||
pub fn arrows_path(path: PathBuf, is_host: bool) -> (PathBuf, PathBuf) {
|
||||
pub fn arrows_path(path: PathBuf, is_host: bool) -> (PathBuf, PathBuf, PathBuf) {
|
||||
let parent = path.parent().unwrap();
|
||||
let p = parent.join("player_arrows");
|
||||
let o = parent.join("player_ping");
|
||||
|
@ -24,7 +24,7 @@ pub fn arrows_path(path: PathBuf, is_host: bool) -> (PathBuf, PathBuf) {
|
|||
p.join("arrow_host.png")
|
||||
} else {
|
||||
p.join("arrow.png")
|
||||
}, o.join("arrow.png"))
|
||||
}, o.join("arrow.png"), parent.join("map/icon.png"))
|
||||
}
|
||||
|
||||
pub fn cursor_path(path: PathBuf) -> PathBuf {
|
||||
|
@ -35,17 +35,27 @@ pub fn cursor_path(path: PathBuf) -> PathBuf {
|
|||
.join("resource/sprites/cursor.png")
|
||||
}
|
||||
|
||||
pub fn compare_rgb(a: Rgba<u8>, b: Rgba<u8>) -> bool {
|
||||
a.channels()[0..3] == b.channels()[0..3]
|
||||
}
|
||||
|
||||
pub fn set_rgb(a: &mut Rgba<u8>, b: Rgba<u8>) {
|
||||
for i in 0..3 {
|
||||
a.channels_mut()[i] = b.channels()[i];
|
||||
}
|
||||
}
|
||||
|
||||
pub fn replace_color(image: &mut RgbaImage, main: Rgba<u8>, alt: Rgba<u8>, arm: Rgba<u8>) {
|
||||
let target_main = Rgba::from([155, 111, 154, 255]);
|
||||
let target_alt = Rgba::from([127, 84, 118, 255]);
|
||||
let target_arm = Rgba::from([89, 67, 84, 255]);
|
||||
for pixel in image.pixels_mut() {
|
||||
if *pixel == target_main {
|
||||
*pixel = main;
|
||||
} else if *pixel == target_alt {
|
||||
*pixel = alt
|
||||
} else if *pixel == target_arm {
|
||||
*pixel = arm
|
||||
if compare_rgb(*pixel, target_main) {
|
||||
set_rgb(pixel, main);
|
||||
} else if compare_rgb(*pixel, target_alt) {
|
||||
set_rgb(pixel, alt);
|
||||
} else if compare_rgb(*pixel, target_arm) {
|
||||
set_rgb(pixel, arm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -304,7 +314,7 @@ pub fn create_player_png(
|
|||
let cosmetics = rgb.cosmetics;
|
||||
let rgb = rgb.colors;
|
||||
let tmp_path = player_path.parent().unwrap();
|
||||
let (arrows_path, ping_path) = arrows_path(tmp_path.into(), is_host);
|
||||
let (arrows_path, ping_path, map_icon) = arrows_path(tmp_path.into(), is_host);
|
||||
let cursor_path = cursor_path(tmp_path.into());
|
||||
let mut img = image::open(player_path).unwrap().into_rgba8();
|
||||
replace_color(
|
||||
|
@ -313,6 +323,14 @@ pub fn create_player_png(
|
|||
Rgba::from(to_u8(rgb.player_alt)),
|
||||
Rgba::from(to_u8(rgb.player_arm)),
|
||||
);
|
||||
let player_lukki = player_path.parent().unwrap().join("unmodified_lukki.png");
|
||||
let mut img_lukki = image::open(player_lukki).unwrap().into_rgba8();
|
||||
replace_color(
|
||||
&mut img_lukki,
|
||||
Rgba::from(to_u8(rgb.player_main)),
|
||||
Rgba::from(to_u8(rgb.player_alt)),
|
||||
Rgba::from(to_u8(rgb.player_arm)),
|
||||
);
|
||||
let mut img_arrow = image::open(arrows_path).unwrap().into_rgba8();
|
||||
replace_color(
|
||||
&mut img_arrow,
|
||||
|
@ -334,14 +352,25 @@ pub fn create_player_png(
|
|||
Rgba::from(to_u8(rgb.player_alt)),
|
||||
Rgba::from(to_u8(rgb.player_arm)),
|
||||
);
|
||||
let mut img_map_icon = image::open(map_icon).unwrap().into_rgba8();
|
||||
replace_color(
|
||||
&mut img_map_icon,
|
||||
Rgba::from(to_u8(rgb.player_main)),
|
||||
Rgba::from(to_u8(rgb.player_alt)),
|
||||
Rgba::from(to_u8(rgb.player_arm)),
|
||||
);
|
||||
let path = tmp_path.join(format!("tmp/{}.png", id));
|
||||
img.save(path).unwrap();
|
||||
let path = tmp_path.join(format!("tmp/{}_lukki.png", id));
|
||||
img_lukki.save(path).unwrap();
|
||||
let path = tmp_path.join(format!("tmp/{}_arrow.png", id));
|
||||
img_arrow.save(path).unwrap();
|
||||
let path = tmp_path.join(format!("tmp/{}_ping.png", id));
|
||||
img_ping.save(path).unwrap();
|
||||
let path = tmp_path.join(format!("tmp/{}_cursor.png", id));
|
||||
img_cursor.save(path).unwrap();
|
||||
let path = tmp_path.join(format!("tmp/{}_map.png", id));
|
||||
img_map_icon.save(path).unwrap();
|
||||
let img = create_arm(Rgba::from(to_u8(rgb.player_forearm)));
|
||||
let path = tmp_path.join(format!("tmp/{}_arm.png", id));
|
||||
img.save(path).unwrap();
|
||||
|
@ -368,6 +397,15 @@ pub fn create_player_png(
|
|||
id
|
||||
)],
|
||||
);
|
||||
edit_by_replacing(
|
||||
tmp_path.join("unmodified_lukki.xml"),
|
||||
tmp_path.join("tmp/".to_owned() + &id.clone() + "_lukki.xml"),
|
||||
&[
|
||||
(
|
||||
"MARKER_LUKKI_PNG",
|
||||
format!("mods/quant.ew/files/system/player/tmp/{}_lukki.png", id),
|
||||
),
|
||||
]);
|
||||
edit_by_replacing(
|
||||
tmp_path.join("unmodified_base.xml"),
|
||||
tmp_path.join("tmp/".to_owned() + &id.clone() + "_base.xml"),
|
||||
|
@ -403,6 +441,10 @@ pub fn create_player_png(
|
|||
"MARKER_MAIN_SPRITE",
|
||||
format!("mods/quant.ew/files/system/player/tmp/{}.xml", id),
|
||||
),
|
||||
(
|
||||
"MARKER_LUKKI_SPRITE",
|
||||
format!("mods/quant.ew/files/system/player/tmp/{}_lukki.xml", id),
|
||||
),
|
||||
(
|
||||
"MARKER_ARM_SPRITE",
|
||||
format!("mods/quant.ew/files/system/player/tmp/{}_arm.xml", id),
|
||||
|
|
|
@ -20,6 +20,7 @@ local perks_to_ignore = {
|
|||
TELEKINESIS = true,
|
||||
HEARTS_MORE_EXTRA_HP = true,
|
||||
MAP = true,
|
||||
ADVENTURER = true,
|
||||
}
|
||||
|
||||
local global_perks = {
|
||||
|
|
|
@ -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")
|
||||
|
|
BIN
quant.ew/files/system/map/icon.png
Normal file
BIN
quant.ew/files/system/map/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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>
|
||||
|
|
BIN
quant.ew/files/system/player/unmodified_lukki.png
Normal file
BIN
quant.ew/files/system/player/unmodified_lukki.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
604
quant.ew/files/system/player/unmodified_lukki.xml
Normal file
604
quant.ew/files/system/player/unmodified_lukki.xml
Normal 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>
|
|
@ -274,6 +274,14 @@ function OnPlayerSpawned( player_entity ) -- This runs when player entity has be
|
|||
end
|
||||
local controls_component = EntityGetFirstComponentIncludingDisabled(player_entity, "ControlsComponent")
|
||||
ComponentSetValue2(controls_component, "enabled", true)
|
||||
for _, child in ipairs(EntityGetAllChildren(player_entity) or {}) do
|
||||
local com = EntityGetFirstComponentIncludingDisabled(child, "LuaComponent")
|
||||
if com ~= nil and ComponentGetValue2(com, "script_source_file") == "data/scripts/perks/map.lua" then
|
||||
EntityRemoveComponent(child, com)
|
||||
EntityAddComponent2(child, "LuaComponent", {script_source_file = "data/scripts/perks/map.lua"})
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function change_homing(x, y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue