public override void _Ready() { Cam = GetNode <Camera>("SteelCamera"); RocketStart = GetNode <Spatial>("SteelCamera/RocketStart"); MovementReset(); if (Possessed) { GetNode <Camera>("SteelCamera").MakeCurrent(); GetNode <RayCast>("SteelCamera/RayCast").AddException(this); GetNode <MeshInstance>("FPSMesh").Hide(); AddChild(HUDInstance); GhostInstance = ((PackedScene)(GD.Load("res://World/Ghost.tscn"))).Instance() as Ghost; GhostInstance.Hide(); GetParent().CallDeferred("add_child", GhostInstance); SfxManager = GetNode <PlayerSfxManager>("PlayerSfxManager"); } else { SetProcess(false); return; } if (GetTree().IsNetworkServer()) { SetFreeze(false); } ItemGive(new Items.Instance(Items.ID.PLATFORM)); ItemGive(new Items.Instance(Items.ID.WALL)); ItemGive(new Items.Instance(Items.ID.SLOPE)); ItemGive(new Items.Instance(Items.ID.TRIANGLE_WALL)); ItemGive(new Items.Instance(Items.ID.ROCKET_JUMPER)); }
public override void _Ready() { Cam = GetNode <Camera>("SteelCamera"); ViewmodelItem = GetNode <MeshInstance>("SteelCamera/ViewmodelArmJoint/ViewmodelTiltJoint/ViewmodelItem"); ViewmodelItem.RotationDegrees = new Vector3(0, 180, 0); ViewmodelItem.Hide(); ViewmodelTiltJoint = GetNode <Position3D>("SteelCamera/ViewmodelArmJoint/ViewmodelTiltJoint"); ViewmodelArmJoint = GetNode <Position3D>("SteelCamera/ViewmodelArmJoint"); ViewmodelArmJoint.RotationDegrees = new Vector3(); NormalViewmodelArmX = ViewmodelArmJoint.Translation.x; ViewmodelArmJoint.Translation = new Vector3(NormalViewmodelArmX, ViewmodelArmJoint.Translation.y, ViewmodelArmJoint.Translation.z); ProjectileEmitterHinge = GetNode <Spatial>("ProjectileEmitterHinge"); ProjectileEmitter = GetNode <Spatial>("ProjectileEmitterHinge/ProjectileEmitter"); BodyCollision = GetNode <CollisionShape>("BodyCollision"); BodyCapsule = (CapsuleShape)BodyCollision.Shape; Assert.ActualAssert(BodyCapsule.Height == Height); if (Possessed) { Cam.MakeCurrent(); GetNode <RayCast>("SteelCamera/RayCast").AddException(this); GetNode <Spatial>("BodyScene").Free(); AddChild(HUDInstance); GhostInstance = (Ghost)GD.Load <PackedScene>("res://World/Ghost.tscn").Instance(); GhostInstance.Hide(); GetParent().CallDeferred("add_child", GhostInstance); SfxManager = GetNode <PlayerSfxManager>("PlayerSfxManager"); } else { HeadJoint = GetNode("BodyScene").GetNode <Spatial>("HeadJoint"); LegsJoint = GetNode("BodyScene").GetNode <Spatial>("LegsJoint"); RightLegFlames = GetNode("BodyScene").GetNode <CPUParticles>("LegsJoint/RightLegFlames"); LeftLegFlames = GetNode("BodyScene").GetNode <CPUParticles>("LegsJoint/LeftLegFlames"); ThirdPersonItem = GetNode("BodyScene").GetNode <MeshInstance>("ItemMesh"); ShaderMaterial Mat = new ShaderMaterial(); Mat.Shader = Items.TileShader; ThirdPersonItem.MaterialOverride = Mat; Spatial Body = GetNode <Spatial>("BodyScene"); Body.GetNode <HitboxClass>("BodyHitbox").OwningPlayer = this; Body.GetNode <HitboxClass>("HeadJoint/HeadHitbox").OwningPlayer = this; Body.GetNode <HitboxClass>("LegsJoint/LegsHitbox").OwningPlayer = this; World.AddEntityToChunk(this); return; } Reset(); if (Net.Work.IsNetworkServer()) { SetFreeze(false); GiveDefaultItems(); } World.AddEntityToChunk(this); }
public override void _Ready() { Cam = GetNode <Camera>("SteelCamera"); ViewmodelItem = GetNode <MeshInstance>("SteelCamera/ViewmodelArm/ViewmodelItem"); ViewmodelItem.Hide(); ProjectileEmitterHinge = GetNode <Spatial>("ProjectileEmitterHinge"); ProjectileEmitter = GetNode <Spatial>("ProjectileEmitterHinge/ProjectileEmitter"); if (Possessed) { Cam.MakeCurrent(); GetNode <RayCast>("SteelCamera/RayCast").AddException(this); GetNode <Spatial>("BodyScene").Free(); AddChild(HUDInstance); GhostInstance = ((PackedScene)(GD.Load("res://World/Ghost.tscn"))).Instance() as Ghost; GhostInstance.Hide(); GetParent().CallDeferred("add_child", GhostInstance); SfxManager = GetNode <PlayerSfxManager>("PlayerSfxManager"); } else { HeadJoint = GetNode("BodyScene").GetNode <Spatial>("HeadJoint"); LegsJoint = GetNode("BodyScene").GetNode <Spatial>("LegsJoint"); RightLegFlames = GetNode("BodyScene").GetNode <CPUParticles>("LegsJoint/LegFlames/Right"); LeftLegFlames = GetNode("BodyScene").GetNode <CPUParticles>("LegsJoint/LegFlames/Left"); ThirdPersonItem = GetNode("BodyScene").GetNode <MeshInstance>("ItemMesh"); ShaderMaterial Mat = new ShaderMaterial(); Mat.Shader = Items.TileShader; ThirdPersonItem.MaterialOverride = Mat; GetNode <MeshInstance>("SteelCamera/ViewmodelArm").Hide(); GetNode <CPUParticles>("SteelCamera/ViewmodelArm/Forcefield").Hide(); Spatial Body = GetNode <Spatial>("BodyScene"); Body.GetNode <HitboxClass>("BodyHitbox").OwningPlayer = this; Body.GetNode <HitboxClass>("HeadJoint/HeadHitbox").OwningPlayer = this; Body.GetNode <HitboxClass>("LegsJoint/LegsHitbox").OwningPlayer = this; SetProcess(false); return; } Respawn(); if (GetTree().IsNetworkServer()) { SetFreeze(false); } ItemGive(new Items.Instance(Items.ID.PLATFORM)); ItemGive(new Items.Instance(Items.ID.WALL)); ItemGive(new Items.Instance(Items.ID.SLOPE)); ItemGive(new Items.Instance(Items.ID.TRIANGLE_WALL)); ItemGive(new Items.Instance(Items.ID.ROCKET_JUMPER)); ItemGive(new Items.Instance(Items.ID.THUNDERBOLT)); }