Initial version of FinchWorld and TungstonsDumper

This commit is contained in:
Andrew Miner
2025-09-06 22:08:17 -06:00
parent 6ebc151742
commit 5098847b06
4 changed files with 554 additions and 9 deletions
+21 -8
View File
@@ -168,14 +168,26 @@ namespace Oxide.Plugins {
private void CheckSleepiness() {
var today = this.GetDay();
var now = this.GetTime();
if (this.lastYawnDay == today) return;
var now = this.GetTime();
if ((now > GoodNightsSleep.BED_TIME) && (now < GoodNightsSleep.BED_TIME + 1f)) {
Puts("Players standing on their beds should be sleepy");
this.lastYawnDay = today;
foreach (var player in BasePlayer.activePlayerList) {
Effect.server.Run(GoodNightsSleep.YAWN_SOUND, player.transform.position);
var bag = this.FindNearbySleepingBag(player);
if (bag == null) {
Puts($"{player.displayName} isn't standing on a sleeping bag");
continue;
}
if (!this.IsInBase(bag)) {
Puts($"{player.displayName}'s sleeping bag isn't in a base");
continue;
}
player.ChatMessage("You feel your eyelids drooping...");
}
}
}
@@ -263,14 +275,15 @@ namespace Oxide.Plugins {
var position = bag.transform.position + Vector3.up * 0.5f;
// check that there's some kind of player-placed block under the sleeping bag
RaycastHit hit;
Physics.Raycast(position, Vector3.down, out hit, 2f);
if (hit.collider.GetComponentInParent<BuildingBlock>() == null) {
Puts("Sleeping bag is not on a foundation");
return false;
foreach (var hit in Physics.RaycastAll(position, Vector3.down, 2f)) {
if (!hit.collider) continue;
var obj = hit.collider.gameObject;
if (obj.GetComponentInParent<BuildingBlock>()) return true;
}
return true;
Puts("Sleeping bag is not on a foundation");
return false;
}
private bool IsUnderRoof(SleepingBag bag) {