Skip to content
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

Hazmat Suit improvements #224

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added GFX/HazmatOverlay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified GFX/items/hazmat.b3d
Binary file not shown.
9 changes: 5 additions & 4 deletions Items.bb
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ Function InitItemTemplates()
it = CreateItemTemplate("Bulky Ballistic Vest", "veryfinevest", "GFX\items\vest.x", "GFX\items\INVvest.jpg", "", 0.025,"GFX\items\Vest.png")
it\sound = 2

it = CreateItemTemplate("Hazmat Suit", "hazmatsuit", "GFX\items\hazmat.b3d", "GFX\items\INVhazmat.jpg", "", 0.013)
it = CreateItemTemplate("Hazmat Suit", "hazmatsuit", "GFX\items\hazmat.b3d", "GFX\items\INVhazmat.jpg", "", 0.013, "", "", 1)
it\sound = 2
it = CreateItemTemplate("Hazmat Suit", "hazmatsuit2", "GFX\items\hazmat.b3d", "GFX\items\INVhazmat.jpg", "", 0.013)
it = CreateItemTemplate("Hazmat Suit", "hazmatsuit2", "GFX\items\hazmat.b3d", "GFX\items\INVhazmat.jpg", "", 0.013, "", "", 1)
it\sound = 2
it = CreateItemTemplate("Heavy Hazmat Suit", "hazmatsuit3", "GFX\items\hazmat.b3d", "GFX\items\INVhazmat.jpg", "", 0.013)
it\sound = 2
Expand Down Expand Up @@ -773,8 +773,9 @@ Function DropItem(item.Items,playdropsound%=True)
Select item\itemtemplate\tempname
Case "gasmask", "supergasmask", "gasmask3"
WearingGasMask = False
Case "hazmatsuit", "hazmatsuit2", "hazmatsuit3"
WearingHazmat = False
Case "hazmatsuit", "hazmatsuit2", "hazmatsuit3"
WearingHazmat = False
SetAnimTime(item\model, 4)
Case "vest", "finevest"
WearingVest = False
Case "nvgoggles"
Expand Down
33 changes: 27 additions & 6 deletions Main.bb
Original file line number Diff line number Diff line change
Expand Up @@ -2715,6 +2715,7 @@ DrawLoading(90, True)

Global FogTexture%, Fog%
Global GasMaskTexture%, GasMaskOverlay%
Global HazmatTexture%, HazmatOverlay%
Global InfectTexture%, InfectOverlay%
Global DarkTexture%, Dark%
Global Collider%, Head%
Expand Down Expand Up @@ -4499,21 +4500,31 @@ Function MouseLook()
MoveMouse viewport_center_x, viewport_center_y
EndIf

If WearingGasMask Or WearingHazmat Or Wearing1499 Then
If WearingGasMask Or Wearing1499 Then
If Wearing714 = False Then
If WearingGasMask = 2 Or Wearing1499 = 2 Or WearingHazmat = 2 Then
If WearingGasMask = 2 Or Wearing1499 = 2 Then
Stamina = Min(100, Stamina + (100.0-Stamina)*0.01*FPSfactor)
EndIf
EndIf
If WearingHazmat = 1 Then
Stamina = Min(60, Stamina)
EndIf

ShowEntity(GasMaskOverlay)
Else
HideEntity(GasMaskOverlay)
End If

If WearingHazmat Then
If WearingHazmat = 1 Then
Stamina = Min(60.0, Stamina)
EndIf
If Wearing714 = False Then
If WearingHazmat = 2 Then
Stamina = Min(100, Stamina + (100.0-Stamina)*0.01*FPSfactor)
EndIf
EndIf
ShowEntity(HazmatOverlay)
Else
HideEntity(HazmatOverlay)
EndIf

If (Not WearingNightVision=0) Then
ShowEntity(NVOverlay)
If WearingNightVision=2 Then
Expand Down Expand Up @@ -7937,6 +7948,16 @@ Function LoadEntities()
MoveEntity(GasMaskOverlay, 0, 0, 1.0)
HideEntity(GasMaskOverlay)

HazmatTexture = LoadTexture_Strict("GFX\HazmatOverlay.jpg", 1)
HazmatOverlay = CreateSprite(ark_blur_cam)
ScaleSprite(HazmatOverlay, 1.0, Float(GraphicHeight) / Float(GraphicWidth))
EntityTexture(HazmatOverlay, HazmatTexture)
EntityBlend(HazmatOverlay, 2)
EntityFX(HazmatOverlay, 1)
EntityOrder(HazmatOverlay, -1003)
MoveEntity(HazmatOverlay, 0, 0, 1.0)
HideEntity(HazmatOverlay)

InfectTexture = LoadTexture_Strict("GFX\InfectOverlay.jpg", 1)
InfectOverlay = CreateSprite(ark_blur_cam)
ScaleSprite(InfectOverlay, Max(GraphicWidth / 1024.0, 1.0), Max(GraphicHeight / 1024.0 * 0.8, 0.8))
Expand Down