Skip to content

Improve the behavior of death planes #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
99aa6e7
Add ObjectScript for death planes
Frozenreflex Jul 19, 2021
28ef53a
Fix size of death barrier objects
Frozenreflex Jul 20, 2021
4e451f8
Switch death plane to use SmashAsync
Frozenreflex Jul 20, 2021
fc22164
Merge branch 'dev' of https://github.com/UchuServer/Uchu into enhance…
Frozenreflex Aug 1, 2021
78bd598
Add initial water death plane script
Frozenreflex Aug 3, 2021
b63934d
Switch smasher for death planes to death plane
Frozenreflex Aug 3, 2021
172a31a
Remove comment in DeathPlane
Frozenreflex Aug 3, 2021
4142353
Merge branch 'dev' of github.com:UchuServer/Uchu into enhancement/dea…
TheNexusAvenger Aug 31, 2021
62d1b41
Merge and improve object script loading for LuaScriptComponent and cu…
TheNexusAvenger Aug 31, 2021
58a9671
Add player fall death script.
TheNexusAvenger Aug 31, 2021
831709b
Move death plane scripts.
TheNexusAvenger Aug 31, 2021
2970ac0
Add death (teleport) plane for properties.
TheNexusAvenger Aug 31, 2021
c3a4370
Correct player sphere physics to be at center instead of bottom. (Fix…
TheNexusAvenger Aug 31, 2021
d5c43d5
Disable check for hasCustomClientScript
Frozenreflex Sep 1, 2021
bed88fe
Disable fallback, replace FV death plane objectscript with nativescript
Frozenreflex Sep 2, 2021
3bef1b2
Reformatting
Frozenreflex Sep 2, 2021
4366f2d
Add CapsuleBody (for cylinders)
enteryournamehere Sep 11, 2021
b8dc90e
Capsule-sphere collision test
enteryournamehere Sep 11, 2021
a85a3e4
Clean up some code
enteryournamehere Sep 11, 2021
bd96217
Replace client script names with server ones
enteryournamehere Sep 11, 2021
73c1174
Run native DeathPlane script in multiple worlds
Frozenreflex Sep 13, 2021
234c322
Move PrimitiveModel cube origins from center to bottom
Frozenreflex Sep 17, 2021
5a43b05
Fix scripts linked to client script names
enteryournamehere Sep 17, 2021
9478fe9
Merge branch 'enhancement/death-planes' of github.com:UchuServer/Uchu…
enteryournamehere Sep 17, 2021
28ca057
Merge branch 'dev' of github.com:UchuServer/Uchu into enhancement/dea…
enteryournamehere Sep 17, 2021
fd0aeaf
Correctly split PATH env variable on *nix systems
enteryournamehere Sep 18, 2021
a1ac3fe
Apply binoculars script to all binoculars
enteryournamehere Sep 18, 2021
254d67b
Always give all rewards for achievements
enteryournamehere Sep 19, 2021
7de8b6d
Fix for ghost players after dying to death plane
Frozenreflex Sep 20, 2021
12226ae
Merge branch 'enhancement/death-planes' of https://github.com/UchuSer…
Frozenreflex Sep 20, 2021
66449bb
Fix Instantiate when item is not in Objects table
enteryournamehere Sep 24, 2021
6cd4f5d
Fix not dying after falling near Tortoise Terrace
Frozenreflex Sep 25, 2021
fb70e80
Add LOT-specific scripts.
TheNexusAvenger Sep 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Uchu.StandardScripts/General/DeathPlane.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Numerics;
using System.Threading.Tasks;
using InfectedRose.Core;
using InfectedRose.Lvl;
using Uchu.Physics;
using Uchu.World;
using Uchu.World.Scripting.Native;

namespace Uchu.StandardScripts.General
{
/// <summary>
/// Native implementation of scripts/ai/act/l_act_player_death_trigger.lua
/// </summary>
[ScriptName("l_act_player_death_trigger.lua")]
public class DeathPlane : ObjectScript
{
/// <summary>
/// Creates the object script.
/// </summary>
/// <param name="gameObject">Game object to control with the script.</param>
public DeathPlane(GameObject gameObject) : base(gameObject)
{
//Console.WriteLine("Death barrier positioned at " + gameObject.Transform.Position + ", Scale of GameObject is " + gameObject.Transform.Scale);

var physics = gameObject.GetComponent<PhysicsComponent>();
if (physics == null || physics == default) return;
Listen(physics.OnEnter, other =>
{
if (!(other.GameObject is Player player)) return;
player.GetComponent<DestroyableComponent>().Health = 0;
});
}
}
}
2 changes: 1 addition & 1 deletion Uchu.World/Objects/Components/Server/PhysicsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void SetPhysicsByPath(string path) // We can't read HKX so this is basica
// 640 x 1 x 640. used for https://lu.lcdruniverse.org/explorer/objects/5633
else if (path.Contains("misc_phys_640x640"))
{
size = new Vector3(640, 640, 12.5f)* Math.Abs(GameObject.Transform.Scale);
size = new Vector3(640, 12.5f, 640)* Math.Abs(GameObject.Transform.Scale);
finalObject = BoxBody.Create(Zone.Simulation, Transform.Position, Transform.Rotation, size );
}
// 20 x 50 x 1. used for https://lu.lcdruniverse.org/explorer/objects/8575
Expand Down