Skip to content

Commit

Permalink
FIxed, I hope :/
Browse files Browse the repository at this point in the history
  • Loading branch information
MDFL64 committed Jul 15, 2015
1 parent 2e2b9e6 commit 3d55477
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 27 deletions.
27 changes: 17 additions & 10 deletions entities/entities/ragcom_controller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function ENT:Initialize()

self:DeleteOnRemove(ragdoll)

RAGCOM_CHARS[self:GetChar()].setup(ragdoll)

/*for i=1,100 do
print(i,ragdoll:GetBoneName(i),ragdoll:TranslateBoneToPhysBone(i))
end*/
Expand Down Expand Up @@ -115,13 +117,18 @@ function ENT:Initialize()
self:StepStart(SIDE_LEFT,self:GetStepPos(SIDE_LEFT,control),.1,5)
self:StepStart(SIDE_RIGHT,self:GetStepPos(SIDE_RIGHT,control),.1,5)
else
local ragdoll = self:GetRagdoll()

RAGCOM_CHARS[self:GetChar()].setup(ragdoll)

if self:GetController()==LocalPlayer() then
LocalPlayerController = self
end
//I would fix this gud but I am running out of time FAST
//timer.Simple(.1,function()
//if not IsValid(self) then return end
//local ragdoll = self:GetRagdoll()


//print(">>",self:GetChar())

if self:GetController()==LocalPlayer() then
LocalPlayerController = self
end
//end)
end
end

Expand Down Expand Up @@ -206,7 +213,7 @@ function ENT:PhysicsSimulate(phys_body,dt)

local phys_head = ragdoll:GetPhysicsObjectNum(10)

if self:GetController():KeyPressed(IN_JUMP) then
if self:GetController():KeyDown(IN_JUMP) then
self:EmitSound("player/pl_pain5.wav")
self.limp_timer = 2
local vel = Vector(0,0,900)+self.lean*self:GetEnergy()*10
Expand Down Expand Up @@ -245,11 +252,11 @@ function ENT:PhysicsSimulate(phys_body,dt)
doControl(phys_fistl,phys_body:GetPos()+Vector(0,0,30)+self.yaw:Forward()*10+self.yaw:Right()*-3)
doControl(phys_fistr,phys_body:GetPos()+Vector(0,0,30)+self.yaw:Forward()*10+self.yaw:Right()*3)
else
if self:GetController():KeyPressed(IN_ATTACK) then
if self:GetController():KeyDown(IN_ATTACK) then
self.punch_l=.4
self:EmitSound("npc/vort/claw_swing1.wav")
end
if self:GetController():KeyPressed(IN_ATTACK2) then
if self:GetController():KeyDown(IN_ATTACK2) then
self.punch_r=.4
self:EmitSound("npc/vort/claw_swing2.wav")
end
Expand Down
10 changes: 5 additions & 5 deletions gamemode/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function GM:HUDPaint()
end

if not IsValid(LocalPlayerController) then
draw.SimpleText("You are spectating. Press F1 for help. Press F2 to select a character.","Trebuchet24",ScrW()/2,ScrH()-100,Color(255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText("You are spectating. Press F1 for help. Press F2 to select a character.","Trebuchet18",ScrW()/2,ScrH()-100,black,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
end
end

Expand All @@ -210,8 +210,8 @@ function GM:HUDDrawScoreBoard()
surface.SetDrawColor(grey)
surface.DrawRect(ScrW()/4,85,ScrW()/2,80)

draw.SimpleText(GetHostName(),"Trebuchet24",ScrW()/2,100,black,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText("Ragdoll Combat II: Flatgrass Smash","Trebuchet24",ScrW()/2,125,black,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText(GetHostName(),"Trebuchet18",ScrW()/2,100,black,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText("Ragdoll Combat II: Flatgrass Smash","Trebuchet18",ScrW()/2,125,black,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText("Playing to "..RAGCOM_WINS.." wins.","Trebuchet18",ScrW()/2,150,black,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)

local t = {}
Expand All @@ -223,8 +223,8 @@ function GM:HUDDrawScoreBoard()
for k,ply in pairs(player.GetAll()) do
surface.SetDrawColor(t[ply] and getWeaknessColor(t[ply]) or grey)
surface.DrawRect(ScrW()/4,135+k*35,ScrW()/2,30)
draw.SimpleText(ply:GetName(),"Trebuchet24",ScrW()/4+10,150+k*35,black,TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
draw.SimpleText(ply:Frags()..(ply:Frags()==1 and " Win" or " Wins"),"Trebuchet24",ScrW()/2,150+k*35,black,TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
draw.SimpleText(ply:GetName(),"Trebuchet18",ScrW()/4+10,150+k*35,Color(0,0,0,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
draw.SimpleText(ply:Frags()..(ply:Frags()==1 and " Win" or " Wins"),"Trebuchet18",ScrW()/2,150+k*35,Color(0,0,0,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
end
end
//print(GetHostName())
Expand Down
29 changes: 17 additions & 12 deletions gamemode/resource.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ if SERVER then
resource.AddSingleFile("sound/ragcom/shia_win.wav")
resource.AddSingleFile("sound/ragcom/postal_win.wav")
resource.AddSingleFile("sound/ragcom/postal_fall.wav")
else
RAGCOM_MATS = {}
end

for k,v in pairs(textures) do
local m = Material(v..".png")
CreateMaterial("ragcom_"..k,"VertexLitGeneric",{["$basetexture"] = v})
RAGCOM_MATS[v] = "!ragcom_"..k
end
RAGCOM_MATS = {}

for k,v in pairs(textures) do
local m = Material(v..".png")
if CLIENT then CreateMaterial("ragcom_"..k,"VertexLitGeneric",{["$basetexture"] = v}) end
RAGCOM_MATS[v] = "!ragcom_"..k
end

RAGCOM_CHARS = {
Expand Down Expand Up @@ -145,11 +145,16 @@ RAGCOM_CHARS = {
setup=function(ragdoll)
ragdoll:SetMaterial("models/debug/debugwhite")
ragdoll:SetColor(Color(100,255,50))
local m = ClientsideModel("models/props_junk/watermelon01.mdl")
m:SetParent(ragdoll)
m:SetParentPhysNum(10)
m:SetLocalPos(Vector(0,0,0))
ragdoll:CallOnRemove("mel", function() if IsValid(m) then m:Remove() end end)

if SERVER then
local m = ents.Create("prop_dynamic")
m:SetModel("models/props_junk/watermelon01.mdl")
m:Spawn()
m:SetParent(ragdoll)
m:SetParentPhysNum(10)
m:SetLocalPos(Vector(0,0,0))
ragdoll:DeleteOnRemove(m)
end

end,
neg="garrysmod/balloon_pop_cute.wav",
Expand Down

0 comments on commit 3d55477

Please sign in to comment.