Compare commits

19 Commits

Author SHA1 Message Date
e16a04a4fa devtest map & size and speed tsuf 2025-02-13 14:13:12 +03:00
88202141dd pretty spaces 2025-02-10 15:28:13 +03:00
0ce2007af5 thirdperson for first level 2025-02-10 00:48:54 +03:00
82c976f47f i dont even remember whats there 2025-02-07 22:38:52 +03:00
eea110a67f different approach on boxes 2025-02-04 22:44:58 +03:00
6bc6df8ba4 WIP broken 2 2025-02-04 12:57:13 +03:00
9d429b67e9 WIP broken 2025-02-04 10:50:55 +03:00
c500a069ad .bat fixes n stuff 2025-02-03 10:40:30 +03:00
4b9b37e44c couple tweaks 2025-02-03 01:47:22 +03:00
ff01afd385 wip polylevel mechanics 2025-02-02 22:35:01 +03:00
16cb2688a6 experience tweaks 2025-02-02 20:39:29 +03:00
2742a85f03 UI stuff 2025-02-02 20:14:23 +03:00
b12fb3e050 Added couple checks for AddExperience 2025-01-29 21:21:31 +03:00
f9f2ba3fbd WIP Experirience mechanic 2025-01-29 08:58:34 +03:00
daeaa7bdd4 added polymorph vpc, copied player and mp_flashlight 1 2025-01-27 15:26:04 +03:00
f45bbdf92e a bit different approach 2025-01-26 20:05:16 +03:00
87b184b48a same as last one but for rpg 2025-01-26 04:34:29 +03:00
a7bb3539f4 added temp exp_item and fixed crossbow and mostly physgun 2025-01-26 03:38:21 +03:00
0baf3aaf79 remove .vs folder 2025-01-21 10:38:22 +03:00
76 changed files with 11052 additions and 243 deletions

2
.gitignore vendored
View File

@@ -23,6 +23,8 @@ ipch
*.vpc.sentinel *.vpc.sentinel
/src/.vs
# OSX/Linux build products # OSX/Linux build products
*.mak *.mak
*.mak.vpc_crc *.mak.vpc_crc

Binary file not shown.

View File

@@ -0,0 +1,7 @@
PRT1
4
4
4 0 2 (256 0 576 ) (0 0 576 ) (0 0 0 ) (256 0 0 )
4 0 1 (0 0 0 ) (0 0 576 ) (0 192 576 ) (0 192 0 )
4 1 3 (0 0 0 ) (0 0 576 ) (-704 0 576 ) (-704 0 0 )
4 2 3 (0 0 576 ) (0 0 0 ) (0 -576 0 ) (0 -576 576 )

View File

@@ -0,0 +1,844 @@
versioninfo
{
"editorversion" "400"
"editorbuild" "8869"
"mapversion" "1"
"formatversion" "100"
"prefab" "0"
}
visgroups
{
}
viewsettings
{
"bSnapToGrid" "1"
"bShowGrid" "1"
"bShowLogicalGrid" "0"
"nGridSpacing" "64"
}
palette_plus
{
"color0" "255 255 255"
"color1" "255 255 255"
"color2" "255 255 255"
"color3" "255 255 255"
"color4" "255 255 255"
"color5" "255 255 255"
"color6" "255 255 255"
"color7" "255 255 255"
"color8" "255 255 255"
"color9" "255 255 255"
"color10" "255 255 255"
"color11" "255 255 255"
"color12" "255 255 255"
"color13" "255 255 255"
"color14" "255 255 255"
"color15" "255 255 255"
}
colorcorrection_plus
{
"name0" ""
"weight0" "1"
"name1" ""
"weight1" "1"
"name2" ""
"weight2" "1"
"name3" ""
"weight3" "1"
}
light_plus
{
"samples_sun" "6"
"samples_ambient" "40"
"samples_vis" "256"
"texlight" ""
"incremental_delay" "0"
"bake_dist" "1024"
"radius_scale" "1"
"brightness_scale" "1"
"ao_scale" "0"
"bounced" "1"
"incremental" "1"
"supersample" "0"
"bleed_hack" "1"
"soften_cosine" "0"
"debug" "0"
"cubemap" "1"
}
postprocess_plus
{
"enable" "1"
"copied_from_controller" "0"
"bloom_scale" "1"
"bloom_exponent" "2.5"
"bloom_saturation" "1"
"auto_exposure_min" "0.5"
"auto_exposure_max" "2"
"tonemap_percent_target" "60"
"tonemap_percent_bright_pixels" "2"
"tonemap_min_avg_luminance" "3"
"tonemap_rate" "1"
"vignette_enable" "0"
"vignette_start" "1"
"vignette_end" "2"
"vignette_blur" "0"
}
bgimages_plus
{
}
world
{
"id" "1"
"mapversion" "1"
"classname" "worldspawn"
"detailmaterial" "detail/detailsprites"
"detailvbsp" "detail.vbsp"
"maxpropscreenwidth" "-1"
"skyname" "sky_day01_01"
solid
{
"id" "9"
side
{
"id" "12"
"plane" "(-708 -580 580) (-708 196 580) (260 196 580)"
vertices_plus
{
"v" "-708 -580 580"
"v" "-708 196 580"
"v" "260 196 580"
"v" "260 -580 580"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "11"
"plane" "(-708 196 576) (-708 196 580) (-708 -580 580)"
vertices_plus
{
"v" "-708 196 576"
"v" "-708 196 580"
"v" "-708 -580 580"
"v" "-708 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "10"
"plane" "(260 -580 576) (260 -580 580) (260 196 580)"
vertices_plus
{
"v" "260 -580 576"
"v" "260 -580 580"
"v" "260 196 580"
"v" "260 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "9"
"plane" "(260 196 576) (260 196 580) (-708 196 580)"
vertices_plus
{
"v" "260 196 576"
"v" "260 196 580"
"v" "-708 196 580"
"v" "-708 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "8"
"plane" "(-708 -580 576) (-708 -580 580) (260 -580 580)"
vertices_plus
{
"v" "-708 -580 576"
"v" "-708 -580 580"
"v" "260 -580 580"
"v" "260 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "7"
"plane" "(-708 196 576) (-708 -580 576) (260 -580 576)"
vertices_plus
{
"v" "-708 196 576"
"v" "-708 -580 576"
"v" "260 -580 576"
"v" "260 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "11"
side
{
"id" "18"
"plane" "(-708 196 -4) (-708 -580 -4) (260 -580 -4)"
vertices_plus
{
"v" "-708 196 -4"
"v" "-708 -580 -4"
"v" "260 -580 -4"
"v" "260 196 -4"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "17"
"plane" "(-708 -580 0) (-708 -580 -4) (-708 196 -4)"
vertices_plus
{
"v" "-708 -580 0"
"v" "-708 -580 -4"
"v" "-708 196 -4"
"v" "-708 196 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "16"
"plane" "(260 196 0) (260 196 -4) (260 -580 -4)"
vertices_plus
{
"v" "260 196 0"
"v" "260 196 -4"
"v" "260 -580 -4"
"v" "260 -580 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "15"
"plane" "(-708 196 0) (-708 196 -4) (260 196 -4)"
vertices_plus
{
"v" "-708 196 0"
"v" "-708 196 -4"
"v" "260 196 -4"
"v" "260 196 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "14"
"plane" "(260 -580 0) (260 -580 -4) (-708 -580 -4)"
vertices_plus
{
"v" "260 -580 0"
"v" "260 -580 -4"
"v" "-708 -580 -4"
"v" "-708 -580 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "13"
"plane" "(-708 -580 0) (-708 196 0) (260 196 0)"
vertices_plus
{
"v" "-708 -580 0"
"v" "-708 196 0"
"v" "260 196 0"
"v" "260 -580 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "13"
side
{
"id" "24"
"plane" "(-708 -580 576) (-708 -580 0) (-708 196 0)"
vertices_plus
{
"v" "-708 -580 576"
"v" "-708 -580 0"
"v" "-708 196 0"
"v" "-708 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "23"
"plane" "(-708 196 576) (-708 196 0) (-704 196 0)"
vertices_plus
{
"v" "-708 196 576"
"v" "-708 196 0"
"v" "-704 196 0"
"v" "-704 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "22"
"plane" "(-704 -580 0) (-708 -580 0) (-708 -580 576)"
vertices_plus
{
"v" "-704 -580 0"
"v" "-708 -580 0"
"v" "-708 -580 576"
"v" "-704 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "21"
"plane" "(-708 -580 576) (-708 196 576) (-704 196 576)"
vertices_plus
{
"v" "-708 -580 576"
"v" "-708 196 576"
"v" "-704 196 576"
"v" "-704 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "20"
"plane" "(-708 196 0) (-708 -580 0) (-704 -580 0)"
vertices_plus
{
"v" "-708 196 0"
"v" "-708 -580 0"
"v" "-704 -580 0"
"v" "-704 196 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "19"
"plane" "(-704 196 576) (-704 196 0) (-704 -580 0)"
vertices_plus
{
"v" "-704 196 576"
"v" "-704 196 0"
"v" "-704 -580 0"
"v" "-704 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "15"
side
{
"id" "30"
"plane" "(260 196 576) (260 196 0) (260 -580 0)"
vertices_plus
{
"v" "260 196 576"
"v" "260 196 0"
"v" "260 -580 0"
"v" "260 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "29"
"plane" "(256 196 0) (260 196 0) (260 196 576)"
vertices_plus
{
"v" "256 196 0"
"v" "260 196 0"
"v" "260 196 576"
"v" "256 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "28"
"plane" "(260 -580 576) (260 -580 0) (256 -580 0)"
vertices_plus
{
"v" "260 -580 576"
"v" "260 -580 0"
"v" "256 -580 0"
"v" "256 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "27"
"plane" "(256 196 576) (260 196 576) (260 -580 576)"
vertices_plus
{
"v" "256 196 576"
"v" "260 196 576"
"v" "260 -580 576"
"v" "256 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "26"
"plane" "(256 -580 0) (260 -580 0) (260 196 0)"
vertices_plus
{
"v" "256 -580 0"
"v" "260 -580 0"
"v" "260 196 0"
"v" "256 196 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "25"
"plane" "(256 -580 576) (256 -580 0) (256 196 0)"
vertices_plus
{
"v" "256 -580 576"
"v" "256 -580 0"
"v" "256 196 0"
"v" "256 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "17"
side
{
"id" "36"
"plane" "(-704 196 0) (256 196 0) (256 196 576)"
vertices_plus
{
"v" "-704 196 0"
"v" "256 196 0"
"v" "256 196 576"
"v" "-704 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "35"
"plane" "(-704 192 576) (-704 196 576) (256 196 576)"
vertices_plus
{
"v" "-704 192 576"
"v" "-704 196 576"
"v" "256 196 576"
"v" "256 192 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "34"
"plane" "(256 196 0) (-704 196 0) (-704 192 0)"
vertices_plus
{
"v" "256 196 0"
"v" "-704 196 0"
"v" "-704 192 0"
"v" "256 192 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "33"
"plane" "(-704 192 0) (-704 196 0) (-704 196 576)"
vertices_plus
{
"v" "-704 192 0"
"v" "-704 196 0"
"v" "-704 196 576"
"v" "-704 192 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "32"
"plane" "(256 196 576) (256 196 0) (256 192 0)"
vertices_plus
{
"v" "256 196 576"
"v" "256 196 0"
"v" "256 192 0"
"v" "256 192 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "31"
"plane" "(256 192 0) (-704 192 0) (-704 192 576)"
vertices_plus
{
"v" "256 192 0"
"v" "-704 192 0"
"v" "-704 192 576"
"v" "256 192 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "19"
side
{
"id" "42"
"plane" "(256 -580 0) (-704 -580 0) (-704 -580 576)"
vertices_plus
{
"v" "256 -580 0"
"v" "-704 -580 0"
"v" "-704 -580 576"
"v" "256 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "41"
"plane" "(256 -580 576) (-704 -580 576) (-704 -576 576)"
vertices_plus
{
"v" "256 -580 576"
"v" "-704 -580 576"
"v" "-704 -576 576"
"v" "256 -576 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "40"
"plane" "(-704 -576 0) (-704 -580 0) (256 -580 0)"
vertices_plus
{
"v" "-704 -576 0"
"v" "-704 -580 0"
"v" "256 -580 0"
"v" "256 -576 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "39"
"plane" "(-704 -580 576) (-704 -580 0) (-704 -576 0)"
vertices_plus
{
"v" "-704 -580 576"
"v" "-704 -580 0"
"v" "-704 -576 0"
"v" "-704 -576 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "38"
"plane" "(256 -576 0) (256 -580 0) (256 -580 576)"
vertices_plus
{
"v" "256 -576 0"
"v" "256 -580 0"
"v" "256 -580 576"
"v" "256 -576 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "37"
"plane" "(-704 -576 0) (256 -576 0) (256 -576 576)"
vertices_plus
{
"v" "-704 -576 0"
"v" "256 -576 0"
"v" "256 -576 576"
"v" "-704 -576 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
group
{
"id" "21"
editor
{
"color" "220 220 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
}
entity
{
"id" "50"
"classname" "info_player_deathmatch"
"angles" "0 0 0"
"origin" "-192 -96 1"
editor
{
"color" "0 255 0"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[0 1000]"
}
}
cameras
{
"activecamera" "-1"
}
cordons
{
"active" "0"
}

View File

@@ -0,0 +1,844 @@
versioninfo
{
"editorversion" "400"
"editorbuild" "8869"
"mapversion" "1"
"formatversion" "100"
"prefab" "0"
}
visgroups
{
}
viewsettings
{
"bSnapToGrid" "1"
"bShowGrid" "1"
"bShowLogicalGrid" "0"
"nGridSpacing" "64"
}
palette_plus
{
"color0" "255 255 255"
"color1" "255 255 255"
"color2" "255 255 255"
"color3" "255 255 255"
"color4" "255 255 255"
"color5" "255 255 255"
"color6" "255 255 255"
"color7" "255 255 255"
"color8" "255 255 255"
"color9" "255 255 255"
"color10" "255 255 255"
"color11" "255 255 255"
"color12" "255 255 255"
"color13" "255 255 255"
"color14" "255 255 255"
"color15" "255 255 255"
}
colorcorrection_plus
{
"name0" ""
"weight0" "1"
"name1" ""
"weight1" "1"
"name2" ""
"weight2" "1"
"name3" ""
"weight3" "1"
}
light_plus
{
"samples_sun" "6"
"samples_ambient" "40"
"samples_vis" "256"
"texlight" ""
"incremental_delay" "0"
"bake_dist" "1024"
"radius_scale" "1"
"brightness_scale" "1"
"ao_scale" "0"
"bounced" "1"
"incremental" "1"
"supersample" "0"
"bleed_hack" "1"
"soften_cosine" "0"
"debug" "0"
"cubemap" "1"
}
postprocess_plus
{
"enable" "1"
"copied_from_controller" "0"
"bloom_scale" "1"
"bloom_exponent" "2.5"
"bloom_saturation" "1"
"auto_exposure_min" "0.5"
"auto_exposure_max" "2"
"tonemap_percent_target" "60"
"tonemap_percent_bright_pixels" "2"
"tonemap_min_avg_luminance" "3"
"tonemap_rate" "1"
"vignette_enable" "0"
"vignette_start" "1"
"vignette_end" "2"
"vignette_blur" "0"
}
bgimages_plus
{
}
world
{
"id" "1"
"mapversion" "1"
"classname" "worldspawn"
"detailmaterial" "detail/detailsprites"
"detailvbsp" "detail.vbsp"
"maxpropscreenwidth" "-1"
"skyname" "sky_day01_01"
solid
{
"id" "9"
side
{
"id" "12"
"plane" "(-708 -580 580) (-708 196 580) (260 196 580)"
vertices_plus
{
"v" "-708 -580 580"
"v" "-708 196 580"
"v" "260 196 580"
"v" "260 -580 580"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "11"
"plane" "(-708 196 576) (-708 196 580) (-708 -580 580)"
vertices_plus
{
"v" "-708 196 576"
"v" "-708 196 580"
"v" "-708 -580 580"
"v" "-708 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "10"
"plane" "(260 -580 576) (260 -580 580) (260 196 580)"
vertices_plus
{
"v" "260 -580 576"
"v" "260 -580 580"
"v" "260 196 580"
"v" "260 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "9"
"plane" "(260 196 576) (260 196 580) (-708 196 580)"
vertices_plus
{
"v" "260 196 576"
"v" "260 196 580"
"v" "-708 196 580"
"v" "-708 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "8"
"plane" "(-708 -580 576) (-708 -580 580) (260 -580 580)"
vertices_plus
{
"v" "-708 -580 576"
"v" "-708 -580 580"
"v" "260 -580 580"
"v" "260 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "7"
"plane" "(-708 196 576) (-708 -580 576) (260 -580 576)"
vertices_plus
{
"v" "-708 196 576"
"v" "-708 -580 576"
"v" "260 -580 576"
"v" "260 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "11"
side
{
"id" "18"
"plane" "(-708 196 -4) (-708 -580 -4) (260 -580 -4)"
vertices_plus
{
"v" "-708 196 -4"
"v" "-708 -580 -4"
"v" "260 -580 -4"
"v" "260 196 -4"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "17"
"plane" "(-708 -580 0) (-708 -580 -4) (-708 196 -4)"
vertices_plus
{
"v" "-708 -580 0"
"v" "-708 -580 -4"
"v" "-708 196 -4"
"v" "-708 196 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "16"
"plane" "(260 196 0) (260 196 -4) (260 -580 -4)"
vertices_plus
{
"v" "260 196 0"
"v" "260 196 -4"
"v" "260 -580 -4"
"v" "260 -580 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "15"
"plane" "(-708 196 0) (-708 196 -4) (260 196 -4)"
vertices_plus
{
"v" "-708 196 0"
"v" "-708 196 -4"
"v" "260 196 -4"
"v" "260 196 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "14"
"plane" "(260 -580 0) (260 -580 -4) (-708 -580 -4)"
vertices_plus
{
"v" "260 -580 0"
"v" "260 -580 -4"
"v" "-708 -580 -4"
"v" "-708 -580 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "13"
"plane" "(-708 -580 0) (-708 196 0) (260 196 0)"
vertices_plus
{
"v" "-708 -580 0"
"v" "-708 196 0"
"v" "260 196 0"
"v" "260 -580 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "13"
side
{
"id" "24"
"plane" "(-708 -580 576) (-708 -580 0) (-708 196 0)"
vertices_plus
{
"v" "-708 -580 576"
"v" "-708 -580 0"
"v" "-708 196 0"
"v" "-708 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "23"
"plane" "(-708 196 576) (-708 196 0) (-704 196 0)"
vertices_plus
{
"v" "-708 196 576"
"v" "-708 196 0"
"v" "-704 196 0"
"v" "-704 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "22"
"plane" "(-704 -580 0) (-708 -580 0) (-708 -580 576)"
vertices_plus
{
"v" "-704 -580 0"
"v" "-708 -580 0"
"v" "-708 -580 576"
"v" "-704 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "21"
"plane" "(-708 -580 576) (-708 196 576) (-704 196 576)"
vertices_plus
{
"v" "-708 -580 576"
"v" "-708 196 576"
"v" "-704 196 576"
"v" "-704 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "20"
"plane" "(-708 196 0) (-708 -580 0) (-704 -580 0)"
vertices_plus
{
"v" "-708 196 0"
"v" "-708 -580 0"
"v" "-704 -580 0"
"v" "-704 196 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "19"
"plane" "(-704 196 576) (-704 196 0) (-704 -580 0)"
vertices_plus
{
"v" "-704 196 576"
"v" "-704 196 0"
"v" "-704 -580 0"
"v" "-704 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "15"
side
{
"id" "30"
"plane" "(260 196 576) (260 196 0) (260 -580 0)"
vertices_plus
{
"v" "260 196 576"
"v" "260 196 0"
"v" "260 -580 0"
"v" "260 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "29"
"plane" "(256 196 0) (260 196 0) (260 196 576)"
vertices_plus
{
"v" "256 196 0"
"v" "260 196 0"
"v" "260 196 576"
"v" "256 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "28"
"plane" "(260 -580 576) (260 -580 0) (256 -580 0)"
vertices_plus
{
"v" "260 -580 576"
"v" "260 -580 0"
"v" "256 -580 0"
"v" "256 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "27"
"plane" "(256 196 576) (260 196 576) (260 -580 576)"
vertices_plus
{
"v" "256 196 576"
"v" "260 196 576"
"v" "260 -580 576"
"v" "256 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "26"
"plane" "(256 -580 0) (260 -580 0) (260 196 0)"
vertices_plus
{
"v" "256 -580 0"
"v" "260 -580 0"
"v" "260 196 0"
"v" "256 196 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "25"
"plane" "(256 -580 576) (256 -580 0) (256 196 0)"
vertices_plus
{
"v" "256 -580 576"
"v" "256 -580 0"
"v" "256 196 0"
"v" "256 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "17"
side
{
"id" "36"
"plane" "(-704 196 0) (256 196 0) (256 196 576)"
vertices_plus
{
"v" "-704 196 0"
"v" "256 196 0"
"v" "256 196 576"
"v" "-704 196 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "35"
"plane" "(-704 192 576) (-704 196 576) (256 196 576)"
vertices_plus
{
"v" "-704 192 576"
"v" "-704 196 576"
"v" "256 196 576"
"v" "256 192 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "34"
"plane" "(256 196 0) (-704 196 0) (-704 192 0)"
vertices_plus
{
"v" "256 196 0"
"v" "-704 196 0"
"v" "-704 192 0"
"v" "256 192 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "33"
"plane" "(-704 192 0) (-704 196 0) (-704 196 576)"
vertices_plus
{
"v" "-704 192 0"
"v" "-704 196 0"
"v" "-704 196 576"
"v" "-704 192 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "32"
"plane" "(256 196 576) (256 196 0) (256 192 0)"
vertices_plus
{
"v" "256 196 576"
"v" "256 196 0"
"v" "256 192 0"
"v" "256 192 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "31"
"plane" "(256 192 0) (-704 192 0) (-704 192 576)"
vertices_plus
{
"v" "256 192 0"
"v" "-704 192 0"
"v" "-704 192 576"
"v" "256 192 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "19"
side
{
"id" "42"
"plane" "(256 -580 0) (-704 -580 0) (-704 -580 576)"
vertices_plus
{
"v" "256 -580 0"
"v" "-704 -580 0"
"v" "-704 -580 576"
"v" "256 -580 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "41"
"plane" "(256 -580 576) (-704 -580 576) (-704 -576 576)"
vertices_plus
{
"v" "256 -580 576"
"v" "-704 -580 576"
"v" "-704 -576 576"
"v" "256 -576 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "40"
"plane" "(-704 -576 0) (-704 -580 0) (256 -580 0)"
vertices_plus
{
"v" "-704 -576 0"
"v" "-704 -580 0"
"v" "256 -580 0"
"v" "256 -576 0"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "39"
"plane" "(-704 -580 576) (-704 -580 0) (-704 -576 0)"
vertices_plus
{
"v" "-704 -580 576"
"v" "-704 -580 0"
"v" "-704 -576 0"
"v" "-704 -576 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "38"
"plane" "(256 -576 0) (256 -580 0) (256 -580 576)"
vertices_plus
{
"v" "256 -576 0"
"v" "256 -580 0"
"v" "256 -580 576"
"v" "256 -576 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "37"
"plane" "(-704 -576 0) (256 -576 0) (256 -576 576)"
vertices_plus
{
"v" "-704 -576 0"
"v" "256 -576 0"
"v" "256 -576 576"
"v" "-704 -576 576"
}
"material" "BRICK/BRICKFLOOR001A"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 -0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "21"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
group
{
"id" "21"
editor
{
"color" "220 220 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
}
entity
{
"id" "50"
"classname" "info_player_deathmatch"
"angles" "0 0 0"
"origin" "-192 -96 1"
editor
{
"color" "0 255 0"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[0 1000]"
}
}
cameras
{
"activecamera" "-1"
}
cordons
{
"active" "0"
}

View File

@@ -164,6 +164,37 @@
"PaintBackgroundType" "2" "PaintBackgroundType" "2"
} }
HudExp
{
"fieldName" "HudExp"
"visible" "1"
"enabled" "1"
"xpos" "r100"
"ypos" "r400"
"wide" "50"
"tall" "300"
"ProgressBarFgColor" "255 220 0 255"
"ProgressBarBgColor" "0 0 0 220"
"ProgressBarTextColor" "255 220 0 255"
"ProgressBarX" "25"
"ProgressBarY" "15"
"ProgressBarWidth" "20"
"ProgressBarHeight" "270"
"text_xpos" "8"
"text_ypos" "4"
"text2_xpos" "8"
"text2_ypos" "285"
"text3_xpos" "8"
"text3_ypos" "278"
"PaintBackgroundType" "4"
}
HudFlashlight HudFlashlight
{ {

Binary file not shown.

View File

@@ -1,59 +0,0 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\Huawei\\Documents\\GitHub\\sdk-2013-mp-new\\src\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{17BCE59A-9037-EC8D-433E-F81339E2F1BA}|game\\client\\client_hl2mp.vcxproj|C:\\Users\\Huawei\\Documents\\GitHub\\sdk-2013-mp-new\\src\\game\\shared\\hl2mp\\weapon_physcannon.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{17BCE59A-9037-EC8D-433E-F81339E2F1BA}|game\\client\\client_hl2mp.vcxproj|solutionrelative:game\\shared\\hl2mp\\weapon_physcannon.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "weapon_physcannon.cpp",
"DocumentMoniker": "C:\\Users\\Huawei\\Documents\\GitHub\\sdk-2013-mp-new\\src\\game\\shared\\hl2mp\\weapon_physcannon.cpp",
"RelativeDocumentMoniker": "game\\shared\\hl2mp\\weapon_physcannon.cpp",
"ToolTip": "C:\\Users\\Huawei\\Documents\\GitHub\\sdk-2013-mp-new\\src\\game\\shared\\hl2mp\\weapon_physcannon.cpp",
"RelativeToolTip": "game\\shared\\hl2mp\\weapon_physcannon.cpp",
"ViewState": "AgIAAJQCAAAAAAAAAAAAwLICAAAaAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-01-17T08:23:44.518Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{68487888-204a-11d3-87eb-00c04f7971a5}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}"
}
]
},
{
"DockedWidth": 749,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{004be353-6879-467c-9d1e-9ac23cdf6d49}"
}
]
}
]
}
]
}

View File

@@ -1,59 +0,0 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\Huawei\\Documents\\GitHub\\sdk-2013-mp-new\\src\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{17BCE59A-9037-EC8D-433E-F81339E2F1BA}|game\\client\\client_hl2mp.vcxproj|C:\\Users\\Huawei\\Documents\\GitHub\\sdk-2013-mp-new\\src\\game\\shared\\hl2mp\\weapon_physcannon.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{17BCE59A-9037-EC8D-433E-F81339E2F1BA}|game\\client\\client_hl2mp.vcxproj|solutionrelative:game\\shared\\hl2mp\\weapon_physcannon.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{34e76e81-ee4a-11d0-ae2e-00a0c90fffc3}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{68487888-204a-11d3-87eb-00c04f7971a5}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{d78612c7-9962-4b83-95d9-268046dad23a}"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "weapon_physcannon.cpp",
"DocumentMoniker": "C:\\Users\\Huawei\\Documents\\GitHub\\sdk-2013-mp-new\\src\\game\\shared\\hl2mp\\weapon_physcannon.cpp",
"RelativeDocumentMoniker": "game\\shared\\hl2mp\\weapon_physcannon.cpp",
"ToolTip": "C:\\Users\\Huawei\\Documents\\GitHub\\sdk-2013-mp-new\\src\\game\\shared\\hl2mp\\weapon_physcannon.cpp",
"RelativeToolTip": "game\\shared\\hl2mp\\weapon_physcannon.cpp",
"ViewState": "AgIAAJQCAAAAAAAAAAAAwKkCAAABAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2025-01-17T08:23:44.518Z",
"EditorCaption": ""
}
]
},
{
"DockedWidth": 749,
"SelectedChildIndex": -1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{004be353-6879-467c-9d1e-9ac23cdf6d49}"
}
]
}
]
}
]
}

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
pushd `dirname $0` pushd `dirname $0`
devtools/bin/vpc /hl2mp +everything /mksln everything /f devtools/bin/vpc /polymorph +everything /mksln everything /f
popd popd

View File

@@ -1 +1 @@
devtools\bin\vpc.exe /hl2mp +everything /mksln everything.sln /f devtools\bin\vpc.exe /polymorph +everything /mksln everything.sln /f

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
pushd `dirname $0` pushd `dirname $0`
devtools/bin/vpc /hl2mp +game /mksln games /f devtools/bin/vpc /polymorph +game /mksln games /f
popd popd

View File

@@ -1 +1 @@
devtools\bin\vpc.exe /hl2mp +game /mksln games.sln /f devtools\bin\vpc.exe /polymorph +game /mksln games.sln /f

View File

@@ -433,6 +433,7 @@ BEGIN_RECV_TABLE_NOBASE(C_BaseEntity, DT_BaseEntity)
RecvPropDataTable( "AnimTimeMustBeFirst", 0, 0, &REFERENCE_RECV_TABLE(DT_AnimTimeMustBeFirst) ), RecvPropDataTable( "AnimTimeMustBeFirst", 0, 0, &REFERENCE_RECV_TABLE(DT_AnimTimeMustBeFirst) ),
RecvPropInt( RECVINFO(m_flSimulationTime), 0, RecvProxy_SimulationTime ), RecvPropInt( RECVINFO(m_flSimulationTime), 0, RecvProxy_SimulationTime ),
RecvPropInt( RECVINFO( m_ubInterpolationFrame ) ), RecvPropInt( RECVINFO( m_ubInterpolationFrame ) ),
RecvPropBool( RECVINFO( m_bForceNoInterpolate ) ),
RecvPropVector( RECVINFO_NAME( m_vecNetworkOrigin, m_vecOrigin ) ), RecvPropVector( RECVINFO_NAME( m_vecNetworkOrigin, m_vecOrigin ) ),
#if PREDICTION_ERROR_CHECK_LEVEL > 1 #if PREDICTION_ERROR_CHECK_LEVEL > 1
@@ -965,7 +966,7 @@ C_BaseEntity::C_BaseEntity() :
m_bDeemedInvalid = false; m_bDeemedInvalid = false;
m_bWasDeemedInvalid = false; m_bWasDeemedInvalid = false;
#endif #endif
m_bForceNoInterpolate = false;
ParticleProp()->Init( this ); ParticleProp()->Init( this );
} }
@@ -2994,6 +2995,9 @@ void C_BaseEntity::MoveToLastReceivedPosition( bool force )
bool C_BaseEntity::ShouldInterpolate() bool C_BaseEntity::ShouldInterpolate()
{ {
if(m_bForceNoInterpolate)
return false;
if ( render->GetViewEntity() == index ) if ( render->GetViewEntity() == index )
return true; return true;

View File

@@ -1307,9 +1307,10 @@ public:
byte m_ubInterpolationFrame; byte m_ubInterpolationFrame;
byte m_ubOldInterpolationFrame; byte m_ubOldInterpolationFrame;
bool m_bForceNoInterpolate;
private: private:
// Effects to apply // Effects to apply
int m_fEffects;
unsigned char m_nRenderMode; unsigned char m_nRenderMode;
unsigned char m_nOldRenderMode; unsigned char m_nOldRenderMode;
@@ -1327,6 +1328,8 @@ public:
// Should we interpolate this tick? (Used to be EF_NOINTERP) // Should we interpolate this tick? (Used to be EF_NOINTERP)
bool IsNoInterpolationFrame(); bool IsNoInterpolationFrame();
int m_fEffects;
// //
int m_nNextThinkTick; int m_nNextThinkTick;
int m_nLastThinkTick; int m_nLastThinkTick;

View File

@@ -295,6 +295,7 @@ END_RECV_TABLE()
RecvPropString( RECVINFO(m_szLastPlaceName) ), RecvPropString( RECVINFO(m_szLastPlaceName) ),
RecvPropFloat( RECVINFO(m_flAccelerationSpeed)),
#if defined USES_ECON_ITEMS #if defined USES_ECON_ITEMS
RecvPropUtlVector( RECVINFO_UTLVECTOR( m_hMyWearables ), MAX_WEARABLES_SENT_FROM_SERVER, RecvPropEHandle(NULL, 0, 0) ), RecvPropUtlVector( RECVINFO_UTLVECTOR( m_hMyWearables ), MAX_WEARABLES_SENT_FROM_SERVER, RecvPropEHandle(NULL, 0, 0) ),
@@ -442,6 +443,8 @@ C_BasePlayer::C_BasePlayer() : m_iv_vecViewOffset( "C_BasePlayer::m_iv_vecViewOf
m_nLocalPlayerVisionFlags = 0; m_nLocalPlayerVisionFlags = 0;
ListenForGameEvent( "base_player_teleported" ); ListenForGameEvent( "base_player_teleported" );
m_flAccelerationSpeed = sv_accelerate.GetFloat();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -405,6 +405,9 @@ protected:
public: public:
int m_StuckLast; int m_StuckLast;
float GetAcceleration() { return m_flAccelerationSpeed; }
void SetAcceleration(float acc) { m_flAccelerationSpeed = acc; }
// Data for only the local player // Data for only the local player
CNetworkVarEmbedded( CPlayerLocalData, m_Local ); CNetworkVarEmbedded( CPlayerLocalData, m_Local );
@@ -489,6 +492,8 @@ protected:
bool m_IsFootprintOnLeft; bool m_IsFootprintOnLeft;
private: private:
float m_flAccelerationSpeed;
// Make sure no one calls this... // Make sure no one calls this...
C_BasePlayer& operator=( const C_BasePlayer& src ); C_BasePlayer& operator=( const C_BasePlayer& src );
C_BasePlayer( const C_BasePlayer & ); // not defined, not accessible C_BasePlayer( const C_BasePlayer & ); // not defined, not accessible
@@ -602,7 +607,9 @@ protected:
// Texture names and surface data, used by CGameMovement // Texture names and surface data, used by CGameMovement
int m_surfaceProps; int m_surfaceProps;
surfacedata_t* m_pSurfaceData; surfacedata_t* m_pSurfaceData;
public:
float m_surfaceFriction; float m_surfaceFriction;
protected:
char m_chTextureType; char m_chTextureType;
bool m_bSentFreezeFrame; bool m_bSentFreezeFrame;

View File

@@ -99,7 +99,7 @@ class CBoundedCvar_Interp : public ConVar_ServerBounded
public: public:
CBoundedCvar_Interp() : CBoundedCvar_Interp() :
ConVar_ServerBounded( "cl_interp", ConVar_ServerBounded( "cl_interp",
"0.1", "0.025",
FCVAR_USERINFO | FCVAR_NOT_CONNECTED, FCVAR_USERINFO | FCVAR_NOT_CONNECTED,
"Sets the interpolation amount (bounded on low side by server interp ratio settings).", true, 0.0f, true, 0.5f ) "Sets the interpolation amount (bounded on low side by server interp ratio settings).", true, 0.0f, true, 0.5f )
{ {

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<CodeLite_Project Name="client (hl2mp)" InternalType=""> <CodeLite_Project Name="client (polymorph)" InternalType="">
<Description/> <Description/>
<Dependencies/> <Dependencies/>
<Settings Type="Dynamic Library"> <Settings Type="Dynamic Library">
@@ -14,17 +14,17 @@
</GlobalSettings> </GlobalSettings>
<Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<CustomBuild Enabled="yes"> <CustomBuild Enabled="yes">
<RebuildCommand>make CFG=debug -f client_linux32_hl2mp.mak clean all</RebuildCommand> <RebuildCommand>make CFG=debug -f client_linux32_polymorph.mak clean all</RebuildCommand>
<CleanCommand>make CFG=debug -f client_linux32_hl2mp.mak clean</CleanCommand> <CleanCommand>make CFG=debug -f client_linux32_polymorph.mak clean</CleanCommand>
<BuildCommand>make CFG=debug -f client_linux32_hl2mp.mak -j `getconf _NPROCESSORS_ONLN`</BuildCommand> <BuildCommand>make CFG=debug -f client_linux32_polymorph.mak -j `getconf _NPROCESSORS_ONLN`</BuildCommand>
<WorkingDirectory>$(ProjectPath)</WorkingDirectory> <WorkingDirectory>$(ProjectPath)</WorkingDirectory>
</CustomBuild> </CustomBuild>
</Configuration> </Configuration>
<Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<CustomBuild Enabled="yes"> <CustomBuild Enabled="yes">
<RebuildCommand>make -f client_linux32_hl2mp.mak clean all</RebuildCommand> <RebuildCommand>make -f client_linux32_polymorph.mak clean all</RebuildCommand>
<CleanCommand>make -f client_linux32_hl2mp.mak clean</CleanCommand> <CleanCommand>make -f client_linux32_polymorph.mak clean</CleanCommand>
<BuildCommand>make -f client_linux32_hl2mp.mak -j `getconf _NPROCESSORS_ONLN`</BuildCommand> <BuildCommand>make -f client_linux32_polymorph.mak -j `getconf _NPROCESSORS_ONLN`</BuildCommand>
<WorkingDirectory>$(ProjectPath)</WorkingDirectory> <WorkingDirectory>$(ProjectPath)</WorkingDirectory>
</CustomBuild> </CustomBuild>
</Configuration> </Configuration>
@@ -75,10 +75,7 @@
<File Name="../../game/shared/hl2/basehlcombatweapon_shared.cpp"/> <File Name="../../game/shared/hl2/basehlcombatweapon_shared.cpp"/>
<File Name="../../game/shared/hl2/env_headcrabcanister_shared.cpp"/> <File Name="../../game/shared/hl2/env_headcrabcanister_shared.cpp"/>
<File Name="../../game/shared/hl2/hl2_gamerules.cpp"/> <File Name="../../game/shared/hl2/hl2_gamerules.cpp"/>
<File Name="../../game/shared/hl2/hl2_usermessages.cpp"/>
<File Name="../../game/shared/hl2/hl_gamemovement.cpp"/> <File Name="../../game/shared/hl2/hl_gamemovement.cpp"/>
<File Name="../../game/shared/hl2mp/hl2mp_gamerules.cpp"/>
<File Name="../../game/shared/hl2mp/hl2mp_player_shared.cpp"/>
<File Name="../../game/shared/hl2mp/hl2mp_weapon_parse.cpp"/> <File Name="../../game/shared/hl2mp/hl2mp_weapon_parse.cpp"/>
<File Name="../../game/shared/hl2mp/weapon_357.cpp"/> <File Name="../../game/shared/hl2mp/weapon_357.cpp"/>
<File Name="../../game/shared/hl2mp/weapon_ar2.cpp"/> <File Name="../../game/shared/hl2mp/weapon_ar2.cpp"/>
@@ -111,6 +108,10 @@
<File Name="../../game/shared/physics_shared.cpp"/> <File Name="../../game/shared/physics_shared.cpp"/>
<File Name="../../game/shared/point_bonusmaps_accessor.cpp"/> <File Name="../../game/shared/point_bonusmaps_accessor.cpp"/>
<File Name="../../game/shared/point_posecontroller.cpp"/> <File Name="../../game/shared/point_posecontroller.cpp"/>
<File Name="../../game/shared/polymorph/poly_gamerules.cpp"/>
<File Name="../../game/shared/polymorph/poly_playerlocaldata.cpp"/>
<File Name="../../game/shared/polymorph/poly_player_shared.cpp"/>
<File Name="../../game/shared/polymorph/poly_usermessages.cpp"/>
<File Name="../../game/shared/precache_register.cpp"/> <File Name="../../game/shared/precache_register.cpp"/>
<File Name="../../game/shared/predictableid.cpp"/> <File Name="../../game/shared/predictableid.cpp"/>
<File Name="../../game/shared/predicted_viewmodel.cpp"/> <File Name="../../game/shared/predicted_viewmodel.cpp"/>
@@ -428,16 +429,7 @@
<File Name="hl2/hud_zoom.cpp"/> <File Name="hl2/hud_zoom.cpp"/>
<File Name="hl2/shieldproxy.cpp"/> <File Name="hl2/shieldproxy.cpp"/>
<File Name="hl2/vgui_rootpanel_hl2.cpp"/> <File Name="hl2/vgui_rootpanel_hl2.cpp"/>
<File Name="hl2mp/clientmode_hl2mpnormal.cpp"/>
<File Name="hl2mp/c_hl2mp_player.cpp"/>
<File Name="hl2mp/c_te_hl2mp_shotgun_shot.cpp"/> <File Name="hl2mp/c_te_hl2mp_shotgun_shot.cpp"/>
<File Name="hl2mp/hl2mp_hud_chat.cpp"/>
<File Name="hl2mp/hl2mp_hud_target_id.cpp"/>
<File Name="hl2mp/hl2mp_hud_team.cpp"/>
<File Name="hl2mp/hud_deathnotice.cpp"/>
<File Name="hl2mp/ui/backgroundpanel.cpp"/>
<File Name="hl2mp/ui/hl2mpclientscoreboard.cpp"/>
<File Name="hl2mp/ui/hl2mptextwindow.cpp"/>
<File Name="hltvcamera.cpp"/> <File Name="hltvcamera.cpp"/>
<File Name="hud.cpp"/> <File Name="hud.cpp"/>
<File Name="hud_animationinfo.cpp"/> <File Name="hud_animationinfo.cpp"/>
@@ -491,6 +483,16 @@
<File Name="physpropclientside.cpp"/> <File Name="physpropclientside.cpp"/>
<File Name="playerandobjectenumerator.cpp"/> <File Name="playerandobjectenumerator.cpp"/>
<File Name="playerspawncache.cpp"/> <File Name="playerspawncache.cpp"/>
<File Name="polymorph/clientmode_poly_normal.cpp"/>
<File Name="polymorph/c_poly_player.cpp"/>
<File Name="polymorph/ui/backgroundpanel.cpp"/>
<File Name="polymorph/ui/hud_deathnotice.cpp"/>
<File Name="polymorph/ui/hud_experience.cpp"/>
<File Name="polymorph/ui/poly_clientscoreboard.cpp"/>
<File Name="polymorph/ui/poly_hud_chat.cpp"/>
<File Name="polymorph/ui/poly_hud_target_id.cpp"/>
<File Name="polymorph/ui/poly_hud_team.cpp"/>
<File Name="polymorph/ui/poly_textwindow.cpp"/>
<File Name="prediction.cpp"/> <File Name="prediction.cpp"/>
<File Name="proxyentity.cpp"/> <File Name="proxyentity.cpp"/>
<File Name="ProxyHealth.cpp"/> <File Name="ProxyHealth.cpp"/>
@@ -611,8 +613,6 @@
<File Name="../../game/shared/hl2/hl2_shareddefs.h"/> <File Name="../../game/shared/hl2/hl2_shareddefs.h"/>
<File Name="../../game/shared/hl2/hl_gamemovement.h"/> <File Name="../../game/shared/hl2/hl_gamemovement.h"/>
<File Name="../../game/shared/hl2/hl_movedata.h"/> <File Name="../../game/shared/hl2/hl_movedata.h"/>
<File Name="../../game/shared/hl2mp/hl2mp_gamerules.h"/>
<File Name="../../game/shared/hl2mp/hl2mp_player_shared.h"/>
<File Name="../../game/shared/hl2mp/hl2mp_weapon_parse.h"/> <File Name="../../game/shared/hl2mp/hl2mp_weapon_parse.h"/>
<File Name="../../game/shared/hl2mp/weapon_ar2.h"/> <File Name="../../game/shared/hl2mp/weapon_ar2.h"/>
<File Name="../../game/shared/hl2mp/weapon_hl2mpbase.h"/> <File Name="../../game/shared/hl2mp/weapon_hl2mpbase.h"/>
@@ -646,6 +646,10 @@
<File Name="../../game/shared/playernet_vars.h"/> <File Name="../../game/shared/playernet_vars.h"/>
<File Name="../../game/shared/point_bonusmaps_accessor.h"/> <File Name="../../game/shared/point_bonusmaps_accessor.h"/>
<File Name="../../game/shared/point_posecontroller.h"/> <File Name="../../game/shared/point_posecontroller.h"/>
<File Name="../../game/shared/polymorph/poly_gamerules.h"/>
<File Name="../../game/shared/polymorph/poly_playerlocaldata.h"/>
<File Name="../../game/shared/polymorph/poly_player_shared.h"/>
<File Name="../../game/shared/polymorph/poly_shareddefs.h"/>
<File Name="../../game/shared/positionwatcher.h"/> <File Name="../../game/shared/positionwatcher.h"/>
<File Name="../../game/shared/precache_register.h"/> <File Name="../../game/shared/precache_register.h"/>
<File Name="../../game/shared/precipitation_shared.h"/> <File Name="../../game/shared/precipitation_shared.h"/>
@@ -1040,12 +1044,6 @@
<File Name="hl2/c_prop_combine_ball.h"/> <File Name="hl2/c_prop_combine_ball.h"/>
<File Name="hl2/c_vehicle_crane.h"/> <File Name="hl2/c_vehicle_crane.h"/>
<File Name="hl2/hud_suitpower.h"/> <File Name="hl2/hud_suitpower.h"/>
<File Name="hl2mp/clientmode_hl2mpnormal.h"/>
<File Name="hl2mp/c_hl2mp_player.h"/>
<File Name="hl2mp/hl2mp_hud_chat.h"/>
<File Name="hl2mp/ui/backgroundpanel.h"/>
<File Name="hl2mp/ui/hl2mpclientscoreboard.h"/>
<File Name="hl2mp/ui/hl2mptextwindow.h"/>
<File Name="hltvcamera.h"/> <File Name="hltvcamera.h"/>
<File Name="hud.h"/> <File Name="hud.h"/>
<File Name="hudelement.h"/> <File Name="hudelement.h"/>
@@ -1114,6 +1112,13 @@
<File Name="playerandobjectenumerator.h"/> <File Name="playerandobjectenumerator.h"/>
<File Name="playerenumerator.h"/> <File Name="playerenumerator.h"/>
<File Name="playerspawncache.h"/> <File Name="playerspawncache.h"/>
<File Name="polymorph/clientmode_poly_normal.h"/>
<File Name="polymorph/c_poly_player.h"/>
<File Name="polymorph/ui/backgroundpanel.h"/>
<File Name="polymorph/ui/hud_experience.h"/>
<File Name="polymorph/ui/poly_clientscoreboard.h"/>
<File Name="polymorph/ui/poly_hud_chat.h"/>
<File Name="polymorph/ui/poly_textwindow.h"/>
<File Name="prediction.h"/> <File Name="prediction.h"/>
<File Name="prediction_private.h"/> <File Name="prediction_private.h"/>
<File Name="proxyentity.h"/> <File Name="proxyentity.h"/>
@@ -1175,7 +1180,7 @@
<File Name="../../vpc_scripts/source_video_base.vpc"/> <File Name="../../vpc_scripts/source_video_base.vpc"/>
<File Name="../../vpc_scripts/version.vpc"/> <File Name="../../vpc_scripts/version.vpc"/>
<File Name="../../vpc_scripts/version.vpc"/> <File Name="../../vpc_scripts/version.vpc"/>
<File Name="client_hl2mp.vpc"/> <File Name="client_polymorph.vpc"/>
<File Name="client_hl2mp.vpc"/> <File Name="client_polymorph.vpc"/>
</VirtualDirectory> </VirtualDirectory>
</CodeLite_Project> </CodeLite_Project>

View File

@@ -0,0 +1,186 @@
//-----------------------------------------------------------------------------
// CLIENT_HL2MP.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
$Macro GAMENAME "mod_hl2mp"
$Include "$SRCDIR\game\client\client_base.vpc"
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;hl2mp\ui,.\hl2mp,$SRCDIR\game\shared\hl2mp,.\hl2,.\hl2\elements,$SRCDIR\game\shared\hl2"
$AdditionalIncludeDirectories "$BASE;.\polymorph,$SRCDIR\game\shared\polymorph,$SRCDIR\game\shared\polymorph"
$PreprocessorDefinitions "$BASE;HL2MP;HL2_CLIENT_DLL;POLY"
}
}
$Project "Client (polymorph)"
{
$Folder "Source Files"
{
$Folder "polymorph"
{
$File "polymorph/c_poly_player.cpp"
$File "polymorph/c_poly_player.h"
$File "$SRCDIR\game\shared\polymorph/poly_playerlocaldata.h"
$File "$SRCDIR\game\shared\polymorph/poly_playerlocaldata.cpp"
$File "$SRCDIR\game\shared\polymorph\poly_gamerules.cpp"
$File "$SRCDIR\game\shared\polymorph\poly_gamerules.h"
$File "$SRCDIR\game\shared\polymorph\poly_player_shared.cpp"
$File "$SRCDIR\game\shared\polymorph\poly_player_shared.h"
$File "$SRCDIR\game\shared\polymorph\poly_shareddefs.h"
$File "$SRCDIR\game\shared\polymorph\poly_usermessages.cpp"
$File "polymorph\clientmode_poly_normal.cpp"
$File "polymorph\clientmode_poly_normal.h"
$Folder "UI"
{
$File "polymorph\ui\backgroundpanel.cpp"
$File "polymorph\ui\backgroundpanel.h"
$File "polymorph\ui\poly_hud_chat.cpp"
$File "polymorph\ui\poly_hud_chat.h"
$File "polymorph\ui\poly_hud_target_id.cpp"
$File "polymorph\ui\poly_hud_team.cpp"
$File "polymorph\ui\poly_clientscoreboard.cpp"
$File "polymorph\ui\poly_clientscoreboard.h"
$File "polymorph\ui\poly_textwindow.cpp"
$File "polymorph\ui\poly_textwindow.h"
$File "polymorph\ui\hud_deathnotice.cpp"
$File "polymorph\ui\hud_experience.cpp"
$File "polymorph\ui\hud_experience.h"
}
}
-$File "$SRCDIR\game\shared\weapon_parse_default.cpp"
$File "c_team_objectiveresource.cpp"
$File "c_team_objectiveresource.h"
$File "c_team_train_watcher.cpp"
$File "c_team_train_watcher.h"
$File "hud_voicestatus.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.h"
$File "$SRCDIR\game\shared\teamplay_round_timer.cpp"
$File "$SRCDIR\game\shared\teamplay_round_timer.h"
$Folder "HL2 DLL"
{
$File "episodic\c_vort_charge_token.cpp"
$File "$SRCDIR\game\shared\hl2\basehlcombatweapon_shared.cpp"
$File "hl2\c_antlion_dust.cpp"
$File "hl2\c_ar2_explosion.cpp"
$File "hl2\c_barnacle.cpp"
$File "hl2\c_barney.cpp"
$File "hl2\c_basehelicopter.cpp"
$File "hl2\c_basehelicopter.h"
$File "hl2\c_basehlcombatweapon.cpp"
$File "hl2\c_basehlcombatweapon.h"
$File "hl2\c_basehlplayer.cpp"
$File "hl2\c_basehlplayer.h"
$File "hl2\c_hl2_playerlocaldata.h"
$File "hl2\c_hl2_playerlocaldata.cpp"
$File "hl2\c_citadel_effects.cpp"
$File "hl2\c_corpse.cpp"
$File "hl2\c_corpse.h"
$File "hl2\c_env_alyxtemp.cpp"
$File "hl2\c_env_headcrabcanister.cpp"
$File "hl2\c_env_starfield.cpp"
$File "hl2\c_func_tankmortar.cpp"
$File "hl2\c_info_teleporter_countdown.cpp"
$File "hl2\c_npc_antlionguard.cpp"
$File "hl2\c_npc_combinegunship.cpp"
$File "hl2\c_npc_manhack.cpp"
$File "hl2\c_npc_rollermine.cpp"
$File "hl2\c_plasma_beam_node.cpp"
$File "hl2\c_prop_combine_ball.cpp"
$File "hl2\c_prop_combine_ball.h"
$File "hl2\c_rotorwash.cpp"
$File "hl2\c_script_intro.cpp"
$File "$SRCDIR\game\shared\script_intro_shared.cpp"
$File "hl2\c_strider.cpp"
$File "hl2\c_te_concussiveexplosion.cpp"
$File "hl2\c_te_flare.cpp"
$File "hl2\c_thumper_dust.cpp"
$File "hl2\c_vehicle_airboat.cpp"
$File "hl2\c_vehicle_cannon.cpp"
$File "hl2\c_vehicle_crane.cpp"
$File "hl2\c_vehicle_crane.h"
$File "hl2\c_vehicle_prisoner_pod.cpp"
$File "hl2\c_weapon__stubs_hl2.cpp"
$File "hl2\c_weapon_crossbow.cpp"
$File "$SRCDIR\game\shared\hl2\citadel_effects_shared.h"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.h"
$File "hl2\fx_antlion.cpp"
$File "hl2\fx_bugbait.cpp"
$File "hl2\fx_hl2_impacts.cpp"
$File "hl2\fx_hl2_tracers.cpp"
$File "hl2\hl2_clientmode.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.h"
$File "$SRCDIR\game\shared\hl2\hl2_shareddefs.h"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.cpp"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.h"
$File "hl2\hl_in_main.cpp"
$File "hl2\hl_prediction.cpp"
$File "hl2\hud_ammo.cpp"
$File "hl2\hud_battery.cpp"
$File "hl2\hud_blood.cpp"
$File "hl2\hud_credits.cpp"
$File "hl2\hud_damageindicator.cpp"
$File "hl2\hud_flashlight.cpp"
$File "hl2\hud_health.cpp"
$File "hl2\hud_poisondamageindicator.cpp"
$File "hl2\hud_quickinfo.cpp"
$File "hud_squadstatus.cpp"
$File "hl2\hud_suitpower.cpp"
$File "hl2\hud_suitpower.h"
$File "hl2\hud_weaponselection.cpp"
$File "hl2\hud_zoom.cpp"
$File "hl2\shieldproxy.cpp"
$File "hl2\vgui_rootpanel_hl2.cpp"
}
$Folder "HL2MP"
{
$File "hl2mp\c_te_hl2mp_shotgun_shot.cpp"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_weapon_parse.cpp"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_weapon_parse.h"
$Folder "Weapons"
{
$File "$SRCDIR\game\shared\hl2mp\weapon_357.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_ar2.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_ar2.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_crossbow.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_crowbar.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_frag.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase_machinegun.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase_machinegun.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasebasebludgeon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasehlmpcombatweapon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasehlmpcombatweapon.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_physcannon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_physcannon.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_pistol.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_rpg.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_rpg.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_shotgun.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_slam.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_slam.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_smg1.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.cpp"
}
}
}
}

View File

@@ -16,6 +16,7 @@
#include "tier0/vprof.h" #include "tier0/vprof.h"
#include "debugoverlay_shared.h" #include "debugoverlay_shared.h"
#include "cam_thirdperson.h" #include "cam_thirdperson.h"
#include "c_poly_player.h"
// memdbgon must be the last include file in a .cpp file!!! // memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h" #include "tier0/memdbgon.h"
@@ -58,16 +59,23 @@ CAM_ToThirdPerson
*/ */
void CAM_ToThirdPerson(void) void CAM_ToThirdPerson(void)
{ {
if ( cl_thirdperson.GetBool() == false ) C_BasePlayer *localPlayer = C_BasePlayer::GetLocalPlayer();
C_HL2MP_Player* pPolyPlayer = (C_HL2MP_Player*)localPlayer;
float scale = 1;
if(pPolyPlayer)
{ {
g_ThirdPersonManager.SetDesiredCameraOffset( Vector( cam_idealdist.GetFloat(), cam_idealdistright.GetFloat(), cam_idealdistup.GetFloat() ) ); scale = g_iaTableExpPerLevel[pPolyPlayer->GetPolyLocal().m_iPolyLevel].player_scale;
g_ThirdPersonManager.SetOverridingThirdPerson( true );
} }
//if ( cl_thirdperson.GetBool() == false )
//{
g_ThirdPersonManager.SetDesiredCameraOffset( Vector( scale * cam_idealdist.GetFloat(), cam_idealdistright.GetFloat(), cam_idealdistup.GetFloat() ) );
g_ThirdPersonManager.SetOverridingThirdPerson( true );
//}
input->CAM_ToThirdPerson(); input->CAM_ToThirdPerson();
// Let the local player know // Let the local player know
C_BasePlayer *localPlayer = C_BasePlayer::GetLocalPlayer();
if ( localPlayer ) if ( localPlayer )
{ {
localPlayer->ThirdPersonSwitch( true ); localPlayer->ThirdPersonSwitch( true );

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,182 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#ifndef HL2MP_PLAYER_H
#define HL2MP_PLAYER_H
#pragma once
class C_HL2MP_Player;
#include "c_basehlplayer.h"
#include "poly_player_shared.h"
#include "poly_playerlocaldata.h"
#include "beamdraw.h"
//=============================================================================
// >> HL2MP_Player
//=============================================================================
class C_HL2MP_Player : public C_BaseHLPlayer
{
public:
DECLARE_CLASS( C_HL2MP_Player, C_BaseHLPlayer );
DECLARE_CLIENTCLASS();
DECLARE_PREDICTABLE();
DECLARE_INTERPOLATION();
C_HL2MP_Player();
~C_HL2MP_Player( void );
void ClientThink( void );
static C_HL2MP_Player* GetLocalHL2MPPlayer();
virtual int DrawModel( int flags );
virtual void AddEntity( void );
QAngle GetAnimEyeAngles( void ) { return m_angEyeAngles; }
Vector GetAttackSpread( CBaseCombatWeapon *pWeapon, CBaseEntity *pTarget = NULL );
// Should this object cast shadows?
virtual ShadowType_t ShadowCastType( void );
virtual C_BaseAnimating *BecomeRagdollOnClient();
virtual const QAngle& GetRenderAngles();
virtual bool ShouldDraw( void );
virtual void OnDataChanged( DataUpdateType_t type );
virtual float GetFOV( void );
virtual CStudioHdr *OnNewModel( void );
virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
virtual void ItemPreFrame( void );
virtual void ItemPostFrame( void );
virtual float GetMinFOV() const { return 5.0f; }
virtual Vector GetAutoaimVector( float flDelta );
virtual void NotifyShouldTransmit( ShouldTransmitState_t state );
virtual void CreateLightEffects( void ) {}
virtual bool ShouldReceiveProjectedTextures( int flags );
virtual void PostDataUpdate( DataUpdateType_t updateType );
virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
virtual void PreThink( void );
virtual void DoImpactEffect( trace_t &tr, int nDamageType );
IRagdoll* GetRepresentativeRagdoll() const;
virtual void CalcView( Vector &eyeOrigin, QAngle &eyeAngles, float &zNear, float &zFar, float &fov );
virtual const QAngle& EyeAngles( void );
bool CanSprint( void );
void StartSprinting( void );
void StopSprinting( void );
void HandleSpeedChanges( void );
void UpdateLookAt( void );
void Initialize( void );
int GetIDTarget() const;
void UpdateIDTarget( void );
void PrecacheFootStepSounds( void );
const char *GetPlayerModelSoundPrefix( void );
HL2MPPlayerState State_Get() const;
// Walking
void StartWalking( void );
void StopWalking( void );
bool IsWalking( void ) { return m_fIsWalking; }
virtual void PostThink( void );
CPolyPlayerLocalData GetPolyLocal()
{
return m_PolyLocal;
}
private:
C_HL2MP_Player( const C_HL2MP_Player & );
CPlayerAnimState m_PlayerAnimState;
QAngle m_angEyeAngles;
CInterpolatedVar< QAngle > m_iv_angEyeAngles;
EHANDLE m_hRagdoll;
int m_headYawPoseParam;
int m_headPitchPoseParam;
float m_headYawMin;
float m_headYawMax;
float m_headPitchMin;
float m_headPitchMax;
bool m_isInit;
Vector m_vLookAtTarget;
float m_flLastBodyYaw;
float m_flCurrentHeadYaw;
float m_flCurrentHeadPitch;
int m_iIDEntIndex;
CountdownTimer m_blinkTimer;
int m_iSpawnInterpCounter;
int m_iSpawnInterpCounterCache;
int m_iPlayerSoundType;
void ReleaseFlashlight( void );
Beam_t *m_pFlashlightBeam;
CNetworkVar( HL2MPPlayerState, m_iPlayerState );
bool m_fIsWalking;
CPolyPlayerLocalData m_PolyLocal;
};
inline C_HL2MP_Player *ToHL2MPPlayer( CBaseEntity *pEntity )
{
if ( !pEntity || !pEntity->IsPlayer() )
return NULL;
return dynamic_cast<C_HL2MP_Player*>( pEntity );
}
class C_HL2MPRagdoll : public C_BaseAnimatingOverlay
{
public:
DECLARE_CLASS( C_HL2MPRagdoll, C_BaseAnimatingOverlay );
DECLARE_CLIENTCLASS();
C_HL2MPRagdoll();
~C_HL2MPRagdoll();
virtual void OnDataChanged( DataUpdateType_t type );
int GetPlayerEntIndex() const;
IRagdoll* GetIRagdoll() const;
void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
void UpdateOnRemove( void );
virtual void SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights );
private:
C_HL2MPRagdoll( const C_HL2MPRagdoll & ) {}
void Interp_Copy( C_BaseAnimatingOverlay *pDestinationEntity );
void CreateHL2MPRagdoll( void );
private:
EHANDLE m_hPlayer;
CNetworkVector( m_vecRagdollVelocity );
CNetworkVector( m_vecRagdollOrigin );
};
#endif //HL2MP_PLAYER_H

View File

@@ -0,0 +1,128 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Draws the normal TF2 or HL2 HUD.
//
// $Workfile: $
// $Date: $
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "clientmode_poly_normal.h"
#include "vgui_int.h"
#include "hud.h"
#include <vgui/IInput.h>
#include <vgui/IPanel.h>
#include <vgui/ISurface.h>
#include <vgui_controls/AnimationController.h>
#include "iinput.h"
#include "ui/poly_clientscoreboard.h"
#include "ui/poly_textwindow.h"
#include "ienginevgui.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
// Globals
//-----------------------------------------------------------------------------
vgui::HScheme g_hVGuiCombineScheme = 0;
// Instance the singleton and expose the interface to it.
IClientMode *GetClientModeNormal()
{
static ClientModeHL2MPNormal g_ClientModeNormal;
return &g_ClientModeNormal;
}
ClientModeHL2MPNormal* GetClientModeHL2MPNormal()
{
Assert( dynamic_cast< ClientModeHL2MPNormal* >( GetClientModeNormal() ) );
return static_cast< ClientModeHL2MPNormal* >( GetClientModeNormal() );
}
//-----------------------------------------------------------------------------
// Purpose: this is the viewport that contains all the hud elements
//-----------------------------------------------------------------------------
class CHudViewport : public CBaseViewport
{
private:
DECLARE_CLASS_SIMPLE( CHudViewport, CBaseViewport );
protected:
virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
gHUD.InitColors( pScheme );
SetPaintBackgroundEnabled( false );
}
virtual IViewPortPanel *CreatePanelByName( const char *szPanelName );
};
int ClientModeHL2MPNormal::GetDeathMessageStartHeight( void )
{
return m_pViewport->GetDeathMessageStartHeight();
}
IViewPortPanel* CHudViewport::CreatePanelByName( const char *szPanelName )
{
IViewPortPanel* newpanel = NULL;
if ( Q_strcmp( PANEL_SCOREBOARD, szPanelName) == 0 )
{
newpanel = new CHL2MPClientScoreBoardDialog( this );
return newpanel;
}
else if ( Q_strcmp(PANEL_INFO, szPanelName) == 0 )
{
newpanel = new CHL2MPTextWindow( this );
return newpanel;
}
else if ( Q_strcmp(PANEL_SPECGUI, szPanelName) == 0 )
{
newpanel = new CHL2MPSpectatorGUI( this );
return newpanel;
}
return BaseClass::CreatePanelByName( szPanelName );
}
//-----------------------------------------------------------------------------
// ClientModeHLNormal implementation
//-----------------------------------------------------------------------------
ClientModeHL2MPNormal::ClientModeHL2MPNormal()
{
m_pViewport = new CHudViewport();
m_pViewport->Start( gameuifuncs, gameeventmanager );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
ClientModeHL2MPNormal::~ClientModeHL2MPNormal()
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void ClientModeHL2MPNormal::Init()
{
BaseClass::Init();
// Load up the combine control panel scheme
g_hVGuiCombineScheme = vgui::scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel( PANEL_CLIENTDLL ), "resource/CombinePanelScheme.res", "CombineScheme" );
if (!g_hVGuiCombineScheme)
{
Warning( "Couldn't load combine panel scheme!\n" );
}
}

View File

@@ -0,0 +1,47 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
// $NoKeywords: $
//=============================================================================//
#if !defined( CLIENTMODE_HLNORMAL_H )
#define CLIENTMODE_HLNORMAL_H
#ifdef _WIN32
#pragma once
#endif
#include "clientmode_shared.h"
#include <vgui_controls/EditablePanel.h>
#include <vgui/Cursor.h>
class CHudViewport;
namespace vgui
{
typedef unsigned long HScheme;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class ClientModeHL2MPNormal : public ClientModeShared
{
public:
DECLARE_CLASS( ClientModeHL2MPNormal, ClientModeShared );
ClientModeHL2MPNormal();
~ClientModeHL2MPNormal();
virtual void Init();
virtual int GetDeathMessageStartHeight( void );
};
extern IClientMode *GetClientModeNormal();
extern vgui::HScheme g_hVGuiCombineScheme;
extern ClientModeHL2MPNormal* GetClientModeHL2MPNormal();
#endif // CLIENTMODE_HLNORMAL_H

View File

@@ -0,0 +1,431 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "backgroundpanel.h"
#include <vgui/IVGui.h>
#include <vgui/IScheme.h>
#include <vgui/ISurface.h>
#include <vgui_controls/Label.h>
#include <vgui/ILocalize.h>
#include "vgui_controls/BuildGroup.h"
#include "vgui_controls/BitmapImagePanel.h"
using namespace vgui;
#define DEBUG_WINDOW_RESIZING 0
#define DEBUG_WINDOW_REPOSITIONING 0
class CaptionLabel : public Label
{
public:
CaptionLabel(Panel *parent, const char *panelName, const char *text) : Label(parent, panelName, text)
{
}
virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
{
Label::ApplySchemeSettings( pScheme );
SetFont( pScheme->GetFont( "MenuTitle", IsProportional() ) );
}
};
//-----------------------------------------------------------------------------
// Purpose: transform a normalized value into one that is scaled based the minimum
// of the horizontal and vertical ratios
//-----------------------------------------------------------------------------
static int GetAlternateProportionalValueFromNormal(int normalizedValue)
{
int wide, tall;
GetHudSize( wide, tall );
int proH, proW;
surface()->GetProportionalBase( proW, proH );
double scaleH = (double)tall / (double)proH;
double scaleW = (double)wide / (double)proW;
double scale = (scaleW < scaleH) ? scaleW : scaleH;
return (int)( normalizedValue * scale );
}
//-----------------------------------------------------------------------------
// Purpose: transform a standard scaled value into one that is scaled based the minimum
// of the horizontal and vertical ratios
//-----------------------------------------------------------------------------
int GetAlternateProportionalValueFromScaled( HScheme hScheme, int scaledValue)
{
return GetAlternateProportionalValueFromNormal( scheme()->GetProportionalNormalizedValueEx( hScheme, scaledValue ) );
}
//-----------------------------------------------------------------------------
// Purpose: moves and resizes a single control
//-----------------------------------------------------------------------------
static void RepositionControl( Panel *pPanel )
{
int x, y, w, h;
pPanel->GetBounds(x, y, w, h);
#if DEBUG_WINDOW_RESIZING
int x1, y1, w1, h1;
pPanel->GetBounds(x1, y1, w1, h1);
int x2, y2, w2, h2;
x2 = scheme()->GetProportionalNormalizedValueEx( pPanel->GetScheme(), x1 );
y2 = scheme()->GetProportionalNormalizedValueEx( pPanel->GetScheme(), y1 );
w2 = scheme()->GetProportionalNormalizedValueEx( pPanel->GetScheme(), w1 );
h2 = scheme()->GetProportionalNormalizedValueEx( pPanel->GetScheme(), h1 );
#endif
x = GetAlternateProportionalValueFromScaled(pPanel->GetScheme(),x);
y = GetAlternateProportionalValueFromScaled(pPanel->GetScheme(),y);
w = GetAlternateProportionalValueFromScaled(pPanel->GetScheme(),w);
h = GetAlternateProportionalValueFromScaled(pPanel->GetScheme(),h);
pPanel->SetBounds(x, y, w, h);
#if DEBUG_WINDOW_RESIZING
DevMsg( "Resizing '%s' from (%d,%d) %dx%d to (%d,%d) %dx%d -- initially was (%d,%d) %dx%d\n",
pPanel->GetName(), x1, y1, w1, h1, x, y, w, h, x2, y2, w2, h2 );
#endif
}
//-----------------------------------------------------------------------------
// Purpose: Sets colors etc for background image panels
//-----------------------------------------------------------------------------
void ApplyBackgroundSchemeSettings( EditablePanel *pWindow, vgui::IScheme *pScheme )
{
Color bgColor = Color( 255, 255, 255, pScheme->GetColor( "BgColor", Color( 0, 0, 0, 0 ) )[3] );
Color fgColor = pScheme->GetColor( "FgColor", Color( 0, 0, 0, 0 ) );
if ( !pWindow )
return;
CBitmapImagePanel *pBitmapPanel;
// corners --------------------------------------------
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "TopLeftPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "TopRightPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "BottomLeftPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "BottomRightPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
// background -----------------------------------------
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "TopSolid" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "UpperMiddleSolid" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "LowerMiddleSolid" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "BottomSolid" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
// Logo -----------------------------------------------
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "ExclamationPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( fgColor );
}
}
//-----------------------------------------------------------------------------
// Purpose: Re-aligns background image panels so they are touching.
//-----------------------------------------------------------------------------
static void FixupBackgroundPanels( EditablePanel *pWindow, int offsetX, int offsetY )
{
if ( !pWindow )
return;
int screenWide, screenTall;
pWindow->GetSize( screenWide, screenTall );
int inset = GetAlternateProportionalValueFromNormal( 20 );
int cornerSize = GetAlternateProportionalValueFromNormal( 10 );
int titleHeight = GetAlternateProportionalValueFromNormal( 42 );
int mainHeight = GetAlternateProportionalValueFromNormal( 376 );
int logoSize = titleHeight;
int captionInset = GetAlternateProportionalValueFromNormal( 76 );
Panel *pPanel;
// corners --------------------------------------------
pPanel = pWindow->FindChildByName( "TopLeftPanel" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset, offsetY + inset, cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "TopRightPanel" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( screenWide - offsetX - inset - cornerSize, offsetY + inset, cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "BottomLeftPanel" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset, screenTall - offsetY - inset - cornerSize, cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "BottomRightPanel" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( screenWide - offsetX - inset - cornerSize, screenTall - offsetY - inset - cornerSize, cornerSize, cornerSize );
}
// background -----------------------------------------
pPanel = pWindow->FindChildByName( "TopSolid" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset + cornerSize, offsetY + inset, screenWide - 2*offsetX - 2*inset - 2*cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "UpperMiddleSolid" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset, offsetY + inset + cornerSize, screenWide - 2*offsetX - 2*inset, titleHeight );
}
pPanel = pWindow->FindChildByName( "LowerMiddleSolid" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset + cornerSize, screenTall - offsetY - inset - cornerSize, screenWide - 2*offsetX - 2*inset - 2*cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "BottomSolid" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset, screenTall - offsetY - inset - cornerSize - mainHeight, screenWide - 2*offsetX - 2*inset, mainHeight );
}
// transparent border ---------------------------------
pPanel = pWindow->FindChildByName( "TopClear" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( 0, 0, screenWide, offsetY + inset );
}
pPanel = pWindow->FindChildByName( "BottomClear" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( 0, screenTall - offsetY - inset, screenWide, offsetY + inset );
}
pPanel = pWindow->FindChildByName( "LeftClear" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( 0, offsetY + inset, offsetX + inset, screenTall - 2*offsetY - 2*inset );
}
pPanel = pWindow->FindChildByName( "RightClear" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( screenWide - offsetX - inset, offsetY + inset, offsetX + inset, screenTall - 2*offsetY - 2*inset );
}
// Logo -----------------------------------------------
int logoInset = (cornerSize + titleHeight - logoSize)/2;
pPanel = pWindow->FindChildByName( "ExclamationPanel" );
if ( pPanel )
{
pPanel->SetZPos( -19 ); // higher than the background
pPanel->SetBounds( offsetX + inset + logoInset, offsetY + inset + logoInset, logoSize, logoSize );
}
// Title caption --------------------------------------
pPanel = dynamic_cast< Label * >(pWindow->FindChildByName( "CaptionLabel" ));
if ( pPanel )
{
pPanel->SetZPos( -19 ); // higher than the background
pPanel->SetBounds( offsetX + captionInset/*inset + 2*logoInset + logoSize*/, offsetY + inset + logoInset, screenWide, logoSize );
}
}
//-----------------------------------------------------------------------------
// Purpose: Creates background image panels
//-----------------------------------------------------------------------------
void CreateBackground( EditablePanel *pWindow )
{
// corners --------------------------------------------
new CBitmapImagePanel( pWindow, "TopLeftPanel", "gfx/vgui/round_corner_nw" );
new CBitmapImagePanel( pWindow, "TopRightPanel", "gfx/vgui/round_corner_ne" );
new CBitmapImagePanel( pWindow, "BottomLeftPanel", "gfx/vgui/round_corner_sw" );
new CBitmapImagePanel( pWindow, "BottomRightPanel", "gfx/vgui/round_corner_se" );
// background -----------------------------------------
new CBitmapImagePanel( pWindow, "TopSolid", "gfx/vgui/solid_background" );
new CBitmapImagePanel( pWindow, "UpperMiddleSolid", "gfx/vgui/solid_background" );
new CBitmapImagePanel( pWindow, "LowerMiddleSolid", "gfx/vgui/solid_background" );
new CBitmapImagePanel( pWindow, "BottomSolid", "gfx/vgui/solid_background" );
// transparent border ---------------------------------
new CBitmapImagePanel( pWindow, "TopClear", "gfx/vgui/trans_background" );
new CBitmapImagePanel( pWindow, "BottomClear", "gfx/vgui/trans_background" );
new CBitmapImagePanel( pWindow, "LeftClear", "gfx/vgui/trans_background" );
new CBitmapImagePanel( pWindow, "RightClear", "gfx/vgui/trans_background" );
// Logo -----------------------------------------------
new CBitmapImagePanel( pWindow, "ExclamationPanel", "gfx/vgui/hl2mp_logo" );
// Title caption --------------------------------------
Panel *pPanel = dynamic_cast< Label * >(pWindow->FindChildByName( "CaptionLabel" ));
if ( !pPanel )
new CaptionLabel( pWindow, "CaptionLabel", "" );
}
void ResizeWindowControls( EditablePanel *pWindow, int tall, int wide, int offsetX, int offsetY )
{
if (!pWindow || !pWindow->GetBuildGroup() || !pWindow->GetBuildGroup()->GetPanelList())
return;
CUtlVector<PHandle> *panelList = pWindow->GetBuildGroup()->GetPanelList();
CUtlVector<Panel *> resizedPanels;
CUtlVector<Panel *> movedPanels;
// Resize to account for 1.25 aspect ratio (1280x1024) screens
{
for ( int i = 0; i < panelList->Size(); ++i )
{
PHandle handle = (*panelList)[i];
Panel *panel = handle.Get();
bool found = false;
for ( int j = 0; j < resizedPanels.Size(); ++j )
{
if (panel == resizedPanels[j])
found = true;
}
if (!panel || found)
{
continue;
}
resizedPanels.AddToTail( panel ); // don't move a panel more than once
if ( panel != pWindow )
{
RepositionControl( panel );
}
}
}
// and now re-center them. Woohoo!
for ( int i = 0; i < panelList->Size(); ++i )
{
PHandle handle = (*panelList)[i];
Panel *panel = handle.Get();
bool found = false;
for ( int j = 0; j < movedPanels.Size(); ++j )
{
if (panel == movedPanels[j])
found = true;
}
if (!panel || found)
{
continue;
}
movedPanels.AddToTail( panel ); // don't move a panel more than once
if ( panel != pWindow )
{
int x, y;
panel->GetPos( x, y );
panel->SetPos( x + offsetX, y + offsetY );
#if DEBUG_WINDOW_REPOSITIONING
DevMsg( "Repositioning '%s' from (%d,%d) to (%d,%d) -- a distance of (%d,%d)\n",
panel->GetName(), x, y, x + offsetX, y + offsetY, offsetX, offsetY );
#endif
}
}
}
//-----------------------------------------------------------------------------
// Purpose: Resizes windows to fit completely on-screen (for 1280x1024), and
// centers them on the screen. Sub-controls are also resized and moved.
//-----------------------------------------------------------------------------
void LayoutBackgroundPanel( EditablePanel *pWindow )
{
if ( !pWindow )
return;
int screenW, screenH;
GetHudSize( screenW, screenH );
int wide, tall;
pWindow->GetSize( wide, tall );
int offsetX = 0;
int offsetY = 0;
// Slide everything over to the center
pWindow->SetBounds( 0, 0, screenW, screenH );
if ( wide != screenW || tall != screenH )
{
wide = GetAlternateProportionalValueFromScaled(pWindow->GetScheme(), wide);
tall = GetAlternateProportionalValueFromScaled(pWindow->GetScheme(), tall);
offsetX = (screenW - wide)/2;
offsetY = (screenH - tall)/2;
ResizeWindowControls( pWindow, tall, wide, offsetX, offsetY );
}
// now that the panels are moved/resized, look for some bg panels, and re-align them
FixupBackgroundPanels( pWindow, offsetX, offsetY );
}
//-----------------------------------------------------------------------------

View File

@@ -0,0 +1,43 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef CSBACKGROUND_H
#define CSBACKGROUND_H
#include <vgui_controls/Frame.h>
#include <vgui_controls/EditablePanel.h>
//-----------------------------------------------------------------------------
// Purpose: Creates background image panels
//-----------------------------------------------------------------------------
void CreateBackground( vgui::EditablePanel *pWindow );
//-----------------------------------------------------------------------------
// Purpose: Resizes windows to fit completely on-screen (for 1280x1024), and
// centers them on the screen. Sub-controls are also resized and moved.
//-----------------------------------------------------------------------------
void LayoutBackgroundPanel( vgui::EditablePanel *pWindow );
//-----------------------------------------------------------------------------
// Purpose: Sets colors etc for background image panels
//-----------------------------------------------------------------------------
void ApplyBackgroundSchemeSettings( vgui::EditablePanel *pWindow, vgui::IScheme *pScheme );
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void ResizeWindowControls( vgui::EditablePanel *pWindow, int tall, int wide, int offsetX, int offsetY );
//-----------------------------------------------------------------------------
// Purpose: transform a standard scaled value into one that is scaled based the minimum
// of the horizontal and vertical ratios
//-----------------------------------------------------------------------------
int GetAlternateProportionalValueFromScaled( vgui::HScheme hScheme, int scaledValue );
//-----------------------------------------------------------------------------
#endif // CSBACKGROUND_H

View File

@@ -0,0 +1,352 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Draws CSPort's death notices
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "hudelement.h"
#include "hud_macros.h"
#include "c_playerresource.h"
#include "clientmode_poly_normal.h"
#include <vgui_controls/Controls.h>
#include <vgui_controls/Panel.h>
#include <vgui/ISurface.h>
#include <vgui/ILocalize.h>
#include <KeyValues.h>
#include "c_baseplayer.h"
#include "c_team.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
static ConVar hud_deathnotice_time( "hud_deathnotice_time", "6", 0 );
// Player entries in a death notice
struct DeathNoticePlayer
{
char szName[MAX_PLAYER_NAME_LENGTH];
int iEntIndex;
};
// Contents of each entry in our list of death notices
struct DeathNoticeItem
{
DeathNoticePlayer Killer;
DeathNoticePlayer Victim;
CHudTexture *iconDeath;
int iSuicide;
float flDisplayTime;
bool bHeadshot;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CHudDeathNotice : public CHudElement, public vgui::Panel
{
DECLARE_CLASS_SIMPLE( CHudDeathNotice, vgui::Panel );
public:
CHudDeathNotice( const char *pElementName );
void Init( void );
void VidInit( void );
virtual bool ShouldDraw( void );
virtual void Paint( void );
virtual void ApplySchemeSettings( vgui::IScheme *scheme );
void SetColorForNoticePlayer( int iTeamNumber );
void RetireExpiredDeathNotices( void );
virtual void FireGameEvent( IGameEvent * event );
private:
CPanelAnimationVarAliasType( float, m_flLineHeight, "LineHeight", "15", "proportional_float" );
CPanelAnimationVar( float, m_flMaxDeathNotices, "MaxDeathNotices", "4" );
CPanelAnimationVar( bool, m_bRightJustify, "RightJustify", "1" );
CPanelAnimationVar( vgui::HFont, m_hTextFont, "TextFont", "HudNumbersTimer" );
// Texture for skull symbol
CHudTexture *m_iconD_skull;
CHudTexture *m_iconD_headshot;
CUtlVector<DeathNoticeItem> m_DeathNotices;
};
using namespace vgui;
DECLARE_HUDELEMENT( CHudDeathNotice );
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CHudDeathNotice::CHudDeathNotice( const char *pElementName ) :
CHudElement( pElementName ), BaseClass( NULL, "HudDeathNotice" )
{
vgui::Panel *pParent = g_pClientMode->GetViewport();
SetParent( pParent );
m_iconD_headshot = NULL;
m_iconD_skull = NULL;
SetHiddenBits( HIDEHUD_MISCSTATUS );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudDeathNotice::ApplySchemeSettings( IScheme *scheme )
{
BaseClass::ApplySchemeSettings( scheme );
SetPaintBackgroundEnabled( false );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudDeathNotice::Init( void )
{
ListenForGameEvent( "player_death" );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudDeathNotice::VidInit( void )
{
m_iconD_skull = gHUD.GetIcon( "d_skull" );
m_DeathNotices.Purge();
}
//-----------------------------------------------------------------------------
// Purpose: Draw if we've got at least one death notice in the queue
//-----------------------------------------------------------------------------
bool CHudDeathNotice::ShouldDraw( void )
{
return ( CHudElement::ShouldDraw() && ( m_DeathNotices.Count() ) );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudDeathNotice::SetColorForNoticePlayer( int iTeamNumber )
{
surface()->DrawSetTextColor( GameResources()->GetTeamColor( iTeamNumber ) );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudDeathNotice::Paint()
{
if ( !m_iconD_skull )
return;
int yStart = GetClientModeHL2MPNormal()->GetDeathMessageStartHeight();
surface()->DrawSetTextFont( m_hTextFont );
surface()->DrawSetTextColor( GameResources()->GetTeamColor( 0 ) );
int iCount = m_DeathNotices.Count();
for ( int i = 0; i < iCount; i++ )
{
CHudTexture *icon = m_DeathNotices[i].iconDeath;
if ( !icon )
continue;
wchar_t victim[ 256 ];
wchar_t killer[ 256 ];
// Get the team numbers for the players involved
int iKillerTeam = 0;
int iVictimTeam = 0;
if( g_PR )
{
iKillerTeam = g_PR->GetTeam( m_DeathNotices[i].Killer.iEntIndex );
iVictimTeam = g_PR->GetTeam( m_DeathNotices[i].Victim.iEntIndex );
}
g_pVGuiLocalize->ConvertANSIToUnicode( m_DeathNotices[i].Victim.szName, victim, sizeof( victim ) );
g_pVGuiLocalize->ConvertANSIToUnicode( m_DeathNotices[i].Killer.szName, killer, sizeof( killer ) );
// Get the local position for this notice
int len = UTIL_ComputeStringWidth( m_hTextFont, victim );
int y = yStart + (m_flLineHeight * i);
int iconWide;
int iconTall;
if( icon->bRenderUsingFont )
{
iconWide = surface()->GetCharacterWidth( icon->hFont, icon->cCharacterInFont );
iconTall = surface()->GetFontTall( icon->hFont );
}
else
{
float scale = ( (float)ScreenHeight() / 480.0f ); //scale based on 640x480
iconWide = (int)( scale * (float)icon->Width() );
iconTall = (int)( scale * (float)icon->Height() );
}
int x;
if ( m_bRightJustify )
{
x = GetWide() - len - iconWide;
}
else
{
x = 0;
}
// Only draw killers name if it wasn't a suicide
if ( !m_DeathNotices[i].iSuicide )
{
if ( m_bRightJustify )
{
x -= UTIL_ComputeStringWidth( m_hTextFont, killer );
}
SetColorForNoticePlayer( iKillerTeam );
// Draw killer's name
surface()->DrawSetTextPos( x, y );
surface()->DrawSetTextFont( m_hTextFont );
surface()->DrawUnicodeString( killer );
surface()->DrawGetTextPos( x, y );
}
Color iconColor( 255, 80, 0, 255 );
// Draw death weapon
//If we're using a font char, this will ignore iconTall and iconWide
icon->DrawSelf( x, y, iconWide, iconTall, iconColor );
x += iconWide;
SetColorForNoticePlayer( iVictimTeam );
// Draw victims name
surface()->DrawSetTextPos( x, y );
surface()->DrawSetTextFont( m_hTextFont ); //reset the font, draw icon can change it
surface()->DrawUnicodeString( victim );
}
// Now retire any death notices that have expired
RetireExpiredDeathNotices();
}
//-----------------------------------------------------------------------------
// Purpose: This message handler may be better off elsewhere
//-----------------------------------------------------------------------------
void CHudDeathNotice::RetireExpiredDeathNotices( void )
{
// Loop backwards because we might remove one
int iSize = m_DeathNotices.Size();
for ( int i = iSize-1; i >= 0; i-- )
{
if ( m_DeathNotices[i].flDisplayTime < gpGlobals->curtime )
{
m_DeathNotices.Remove(i);
}
}
}
//-----------------------------------------------------------------------------
// Purpose: Server's told us that someone's died
//-----------------------------------------------------------------------------
void CHudDeathNotice::FireGameEvent( IGameEvent * event )
{
if (!g_PR)
return;
if ( hud_deathnotice_time.GetFloat() == 0 )
return;
// the event should be "player_death"
int killer = engine->GetPlayerForUserID( event->GetInt("attacker") );
int victim = engine->GetPlayerForUserID( event->GetInt("userid") );
const char *killedwith = event->GetString( "weapon" );
char fullkilledwith[128];
if ( killedwith && *killedwith )
{
Q_snprintf( fullkilledwith, sizeof(fullkilledwith), "death_%s", killedwith );
}
else
{
fullkilledwith[0] = 0;
}
// Do we have too many death messages in the queue?
if ( m_DeathNotices.Count() > 0 &&
m_DeathNotices.Count() >= (int)m_flMaxDeathNotices )
{
// Remove the oldest one in the queue, which will always be the first
m_DeathNotices.Remove(0);
}
// Get the names of the players
const char *killer_name = g_PR->GetPlayerName( killer );
const char *victim_name = g_PR->GetPlayerName( victim );
if ( !killer_name )
killer_name = "";
if ( !victim_name )
victim_name = "";
// Make a new death notice
DeathNoticeItem deathMsg;
deathMsg.Killer.iEntIndex = killer;
deathMsg.Victim.iEntIndex = victim;
Q_strncpy( deathMsg.Killer.szName, killer_name, MAX_PLAYER_NAME_LENGTH );
Q_strncpy( deathMsg.Victim.szName, victim_name, MAX_PLAYER_NAME_LENGTH );
deathMsg.flDisplayTime = gpGlobals->curtime + hud_deathnotice_time.GetFloat();
deathMsg.iSuicide = ( !killer || killer == victim );
// Try and find the death identifier in the icon list
deathMsg.iconDeath = gHUD.GetIcon( fullkilledwith );
if ( !deathMsg.iconDeath || deathMsg.iSuicide )
{
// Can't find it, so use the default skull & crossbones icon
deathMsg.iconDeath = m_iconD_skull;
}
// Add it to our list of death notices
m_DeathNotices.AddToTail( deathMsg );
char sDeathMsg[512];
// Record the death notice in the console
if ( deathMsg.iSuicide )
{
if ( !strcmp( fullkilledwith, "d_worldspawn" ) )
{
Q_snprintf( sDeathMsg, sizeof( sDeathMsg ), "%s died.\n", deathMsg.Victim.szName );
}
else //d_world
{
Q_snprintf( sDeathMsg, sizeof( sDeathMsg ), "%s suicided.\n", deathMsg.Victim.szName );
}
}
else
{
Q_snprintf( sDeathMsg, sizeof( sDeathMsg ), "%s killed %s", deathMsg.Killer.szName, deathMsg.Victim.szName );
if ( fullkilledwith && *fullkilledwith && (*fullkilledwith > 13 ) )
{
Q_strncat( sDeathMsg, VarArgs( " with %s.\n", fullkilledwith+6 ), sizeof( sDeathMsg ), COPY_ALL_CHARACTERS );
}
}
Msg( "%s", sDeathMsg );
}

View File

@@ -0,0 +1,193 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "hud.h"
#include "hud_experience.h"
#include "hud_macros.h"
#include "c_basehlplayer.h"
#include "iclientmode.h"
#include <vgui_controls/AnimationController.h>
#include <vgui/ISurface.h>
#include <vgui/ILocalize.h>
#include "c_poly_player.h"
#include <vgui_controls/ProgressBar.h>
using namespace vgui;
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
DECLARE_HUDELEMENT( CHudExp );
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CHudExp::CHudExp( const char *pElementName ) : CHudElement( pElementName ), BaseClass( NULL, "HudExp" )
{
vgui::Panel *pParent = g_pClientMode->GetViewport();
SetParent( pParent );
SetHiddenBits( HIDEHUD_HEALTH | HIDEHUD_PLAYERDEAD );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudExp::Init( void )
{
//m_flSuitPower = SUITPOWER_INIT;
//m_nSuitPowerLow = -1;
//m_iActiveSuitDevices = 0;
m_progressBar = new ContinuousProgressBar(this, "HudExpProgressBar");
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudExp::Reset( void )
{
if(m_progressBar)
delete m_progressBar;
Init();
}
//-----------------------------------------------------------------------------
// Purpose: Save CPU cycles by letting the HUD system early cull
// costly traversal. Called per frame, return true if thinking and
// painting need to occur.
//-----------------------------------------------------------------------------
bool CHudExp::ShouldDraw()
{
bool bNeedsDraw = true;
C_BaseHLPlayer *pPlayer = (C_BaseHLPlayer *)C_BasePlayer::GetLocalPlayer();
if ( !pPlayer )
return false;
//// needs draw if suit power changed or animation in progress
//bNeedsDraw = ( ( pPlayer->m_HL2Local.m_flSuitPower != m_flSuitPower ) || ( m_AuxPowerColor[3] > 0 ) );
return ( bNeedsDraw && CHudElement::ShouldDraw() );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudExp::OnThink( void )
{
//float flCurrentPower = 0;
C_HL2MP_Player *pPlayer = (C_HL2MP_Player *)C_BasePlayer::GetLocalPlayer();
if ( !pPlayer )
return;
//flCurrentPower = pPlayer->m_HL2Local.m_flSuitPower;
int MaxExp = g_iaTableExpPerLevel[pPlayer->GetPolyLocal().m_iPolyLevel].exp;
m_progressBar->SetProgress((float)pPlayer->GetPolyLocal().m_iExpPerLevel / MaxExp);
//Msg("%f", ((float)pPlayer->GetPolyLocal().m_iExpPerLevel / MaxExp));
//m_progressBar->SetProgress(0.5f);
// Only update if we've changed suit power
//if ( flCurrentPower == m_flSuitPower )
// return;
//if ( flCurrentPower >= 100.0f && m_flSuitPower < 100.0f )
//{
// // we've reached max power
// g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("SuitAuxPowerMax");
//}
//else if ( flCurrentPower < 100.0f && (m_flSuitPower >= 100.0f || m_flSuitPower == SUITPOWER_INIT) )
//{
// we've lost power
//g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("SuitAuxPowerNotMax");
//}
//bool flashlightActive = pPlayer->IsFlashlightActive();
//bool sprintActive = pPlayer->IsSprinting();
//bool breatherActive = pPlayer->IsBreatherActive();
//int activeDevices = (int)flashlightActive + (int)sprintActive + (int)breatherActive;
//if (activeDevices != m_iActiveSuitDevices)
//{
// m_iActiveSuitDevices = activeDevices;
// switch ( m_iActiveSuitDevices )
// {
// default:
// case 3:
// g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("SuitAuxPowerThreeItemsActive");
// break;
// case 2:
// g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("SuitAuxPowerTwoItemsActive");
// break;
// case 1:
// g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("SuitAuxPowerOneItemActive");
// break;
// case 0:
// g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("SuitAuxPowerNoItemsActive");
// break;
// }
//}
//m_flSuitPower = flCurrentPower;
}
//-----------------------------------------------------------------------------
// Purpose: draws the power bar
//-----------------------------------------------------------------------------
void CHudExp::Paint()
{
C_HL2MP_Player *pPlayer = (C_HL2MP_Player *)C_BasePlayer::GetLocalPlayer();
if ( !pPlayer )
return;
m_progressBar->SetBounds(m_flProgressBarX, m_flProgressBarY, m_flProgressBarWidth, m_flProgressBarHeight);
m_progressBar->SetProgressDirection(ProgressBar::ProgressDir_e::PROGRESS_NORTH);
m_progressBar->SetFgColor(m_ProgressBarFgColor);
m_progressBar->SetBgColor(m_ProgressBarBgColor);
// draw our name
surface()->DrawSetTextFont(m_hTextFont);
surface()->DrawSetTextColor(m_ProgressBarTextColor);
surface()->DrawSetTextPos(text_xpos, text_ypos);
//wchar_t *tempString = g_pVGuiLocalize->Find("#Valve_Hud_AUX_POWER");
{
surface()->DrawPrintText(L"ABOBA", wcslen(L"ABOBA"));
}
// draw the additional text
//int ypos = text2_ypos;
//tempString = g_pVGuiLocalize->Find("#Valve_Hud_OXYGEN");
surface()->DrawSetTextPos(text2_xpos, text2_ypos);
//if (tempString)
//{
// surface()->DrawPrintText(tempString, wcslen(tempString));
//}
//else
wchar_t tempString[256];
memset(tempString, 0, 256);
swprintf(tempString, 256, L"%hu / %hu", pPlayer->GetPolyLocal().m_iExpPerLevel, g_iaTableExpPerLevel[pPlayer->GetPolyLocal().m_iPolyLevel].exp);
surface()->DrawPrintText(tempString, wcslen(tempString));
surface()->DrawSetTextPos(text3_xpos, text3_ypos);
memset(tempString, 0, 256);
swprintf(tempString, 256, L"%hu", pPlayer->GetPolyLocal().m_iPolyLevel);
surface()->DrawPrintText(tempString, wcslen(tempString));
}

View File

@@ -0,0 +1,59 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#if !defined( HUD_SUITPOWER_H )
#define HUD_SUITPOWER_H
#ifdef _WIN32
#pragma once
#endif
#include "hudelement.h"
#include "hud_numericdisplay.h"
#include <vgui_controls/Panel.h>
#include <vgui_controls/ProgressBar.h>
//-----------------------------------------------------------------------------
// Purpose: Shows the sprint power bar
//-----------------------------------------------------------------------------
class CHudExp : public CHudElement, public vgui::Panel
{
DECLARE_CLASS_SIMPLE( CHudExp, vgui::Panel );
public:
CHudExp( const char *pElementName );
virtual void Init( void );
virtual void Reset( void );
virtual void OnThink( void );
bool ShouldDraw( void );
protected:
virtual void Paint();
private:
CPanelAnimationVar( Color, m_ProgressBarFgColor, "ProgressBarFgColor", "255 220 0 220" );
CPanelAnimationVar( Color, m_ProgressBarBgColor, "ProgressBarBgColor", "255 220 0 220" );
CPanelAnimationVar( Color, m_ProgressBarTextColor, "ProgressBarTextColor", "255 220 0 220" );
CPanelAnimationVarAliasType( float, m_flProgressBarX, "ProgressBarX", "8", "proportional_float" );
CPanelAnimationVarAliasType( float, m_flProgressBarY, "ProgressBarY", "8", "proportional_float" );
CPanelAnimationVarAliasType( float, m_flProgressBarWidth, "ProgressBarWidth", "80", "proportional_float" );
CPanelAnimationVarAliasType( float, m_flProgressBarHeight, "ProgressBarHeight", "10", "proportional_float" );
CPanelAnimationVar( vgui::HFont, m_hTextFont, "TextFont", "Default" );
CPanelAnimationVarAliasType( float, text_xpos, "text_xpos", "8", "proportional_float" );
CPanelAnimationVarAliasType( float, text_ypos, "text_ypos", "20", "proportional_float" );
CPanelAnimationVarAliasType( float, text2_xpos, "text2_xpos", "8", "proportional_float" );
CPanelAnimationVarAliasType( float, text2_ypos, "text2_ypos", "40", "proportional_float" );
CPanelAnimationVarAliasType( float, text3_xpos, "text3_xpos", "8", "proportional_float" );
CPanelAnimationVarAliasType( float, text3_ypos, "text3_ypos", "40", "proportional_float" );
//float m_flSuitPower;
//int m_nSuitPowerLow;
//int m_iActiveSuitDevices;
vgui::ContinuousProgressBar* m_progressBar;
};
#endif // HUD_SUITPOWER_H

View File

@@ -0,0 +1,653 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "hud.h"
#include "poly_clientscoreboard.h"
#include "c_team.h"
#include "c_playerresource.h"
#include "c_poly_player.h"
#include "poly_gamerules.h"
#include <KeyValues.h>
#include <vgui/IScheme.h>
#include <vgui/ILocalize.h>
#include <vgui/ISurface.h>
#include <vgui/IVGui.h>
#include <vgui_controls/SectionedListPanel.h>
#include "voice_status.h"
using namespace vgui;
#define TEAM_MAXCOUNT 5
// id's of sections used in the scoreboard
enum EScoreboardSections
{
SCORESECTION_COMBINE = 1,
SCORESECTION_REBELS = 2,
SCORESECTION_FREEFORALL = 3,
SCORESECTION_SPECTATOR = 4
};
const int NumSegments = 7;
static int coord[NumSegments+1] = {
0,
1,
2,
3,
4,
6,
9,
10
};
//-----------------------------------------------------------------------------
// Purpose: Konstructor
//-----------------------------------------------------------------------------
CHL2MPClientScoreBoardDialog::CHL2MPClientScoreBoardDialog(IViewPort *pViewPort):CClientScoreBoardDialog(pViewPort)
{
}
//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
CHL2MPClientScoreBoardDialog::~CHL2MPClientScoreBoardDialog()
{
}
//-----------------------------------------------------------------------------
// Purpose: Paint background for rounded corners
//-----------------------------------------------------------------------------
void CHL2MPClientScoreBoardDialog::PaintBackground()
{
m_pPlayerList->SetBgColor( Color(0, 0, 0, 0) );
m_pPlayerList->SetBorder(NULL);
int x1, x2, y1, y2;
surface()->DrawSetColor(m_bgColor);
surface()->DrawSetTextColor(m_bgColor);
int wide, tall;
GetSize( wide, tall );
int i;
// top-left corner --------------------------------------------------------
int xDir = 1;
int yDir = -1;
int xIndex = 0;
int yIndex = NumSegments - 1;
int xMult = 1;
int yMult = 1;
int x = 0;
int y = 0;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = y + coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// top-right corner -------------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = wide;
y = 0;
xMult = -1;
yMult = 1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = y + coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// bottom-right corner ----------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = wide;
y = tall;
xMult = -1;
yMult = -1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = y - coord[NumSegments];
y2 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// bottom-left corner -----------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = 0;
y = tall;
xMult = 1;
yMult = -1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = y - coord[NumSegments];
y2 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// paint between top left and bottom left ---------------------------------
x1 = 0;
x2 = coord[NumSegments];
y1 = coord[NumSegments];
y2 = tall - coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
// paint between left and right -------------------------------------------
x1 = coord[NumSegments];
x2 = wide - coord[NumSegments];
y1 = 0;
y2 = tall;
surface()->DrawFilledRect( x1, y1, x2, y2 );
// paint between top right and bottom right -------------------------------
x1 = wide - coord[NumSegments];
x2 = wide;
y1 = coord[NumSegments];
y2 = tall - coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
}
//-----------------------------------------------------------------------------
// Purpose: Paint border for rounded corners
//-----------------------------------------------------------------------------
void CHL2MPClientScoreBoardDialog::PaintBorder()
{
int x1, x2, y1, y2;
surface()->DrawSetColor(m_borderColor);
surface()->DrawSetTextColor(m_borderColor);
int wide, tall;
GetSize( wide, tall );
int i;
// top-left corner --------------------------------------------------------
int xDir = 1;
int yDir = -1;
int xIndex = 0;
int yIndex = NumSegments - 1;
int xMult = 1;
int yMult = 1;
int x = 0;
int y = 0;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// top-right corner -------------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = wide;
y = 0;
xMult = -1;
yMult = 1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// bottom-right corner ----------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = wide;
y = tall;
xMult = -1;
yMult = -1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// bottom-left corner -----------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = 0;
y = tall;
xMult = 1;
yMult = -1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// top --------------------------------------------------------------------
x1 = coord[NumSegments];
x2 = wide - coord[NumSegments];
y1 = 0;
y2 = 1;
surface()->DrawFilledRect( x1, y1, x2, y2 );
// bottom -----------------------------------------------------------------
x1 = coord[NumSegments];
x2 = wide - coord[NumSegments];
y1 = tall - 1;
y2 = tall;
surface()->DrawFilledRect( x1, y1, x2, y2 );
// left -------------------------------------------------------------------
x1 = 0;
x2 = 1;
y1 = coord[NumSegments];
y2 = tall - coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
// right ------------------------------------------------------------------
x1 = wide - 1;
x2 = wide;
y1 = coord[NumSegments];
y2 = tall - coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
}
//-----------------------------------------------------------------------------
// Purpose: Apply scheme settings
//-----------------------------------------------------------------------------
void CHL2MPClientScoreBoardDialog::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
m_bgColor = GetSchemeColor("SectionedListPanel.BgColor", GetBgColor(), pScheme);
m_borderColor = pScheme->GetColor( "FgColor", Color( 0, 0, 0, 0 ) );
SetBgColor( Color(0, 0, 0, 0) );
SetBorder( pScheme->GetBorder( "BaseBorder" ) );
}
//-----------------------------------------------------------------------------
// Purpose: sets up base sections
//-----------------------------------------------------------------------------
void CHL2MPClientScoreBoardDialog::InitScoreboardSections()
{
m_pPlayerList->SetBgColor( Color(0, 0, 0, 0) );
m_pPlayerList->SetBorder(NULL);
// fill out the structure of the scoreboard
AddHeader();
if ( HL2MPRules()->IsTeamplay() )
{
// add the team sections
AddSection( TYPE_TEAM, TEAM_COMBINE );
AddSection( TYPE_TEAM, TEAM_REBELS );
}
else
{
AddSection( TYPE_TEAM, TEAM_UNASSIGNED );
}
AddSection( TYPE_TEAM, TEAM_SPECTATOR );
}
//-----------------------------------------------------------------------------
// Purpose: resets the scoreboard team info
//-----------------------------------------------------------------------------
void CHL2MPClientScoreBoardDialog::UpdateTeamInfo()
{
if ( g_PR == NULL )
return;
int iNumPlayersInGame = 0;
for ( int j = 1; j <= gpGlobals->maxClients; j++ )
{
if ( g_PR->IsConnected( j ) )
{
iNumPlayersInGame++;
}
}
// update the team sections in the scoreboard
for ( int i = TEAM_SPECTATOR; i < TEAM_MAXCOUNT; i++ )
{
wchar_t *teamName = NULL;
int sectionID = 0;
C_Team *team = GetGlobalTeam(i);
if ( team )
{
sectionID = GetSectionFromTeamNumber( i );
// update team name
wchar_t name[64];
wchar_t string1[1024];
wchar_t wNumPlayers[6];
if ( HL2MPRules()->IsTeamplay() == false )
{
_snwprintf( wNumPlayers, ARRAYSIZE(wNumPlayers), L"%i", iNumPlayersInGame );
#ifdef WIN32
_snwprintf( name, ARRAYSIZE(name), L"%s", g_pVGuiLocalize->Find("#ScoreBoard_Deathmatch") );
#else
_snwprintf( name, ARRAYSIZE(name), L"%S", g_pVGuiLocalize->Find("#ScoreBoard_Deathmatch") );
#endif
teamName = name;
if ( iNumPlayersInGame == 1)
{
g_pVGuiLocalize->ConstructString( string1, sizeof(string1), g_pVGuiLocalize->Find("#ScoreBoard_Player"), 2, teamName, wNumPlayers );
}
else
{
g_pVGuiLocalize->ConstructString( string1, sizeof(string1), g_pVGuiLocalize->Find("#ScoreBoard_Players"), 2, teamName, wNumPlayers );
}
}
else
{
_snwprintf(wNumPlayers, ARRAYSIZE(wNumPlayers), L"%i", team->Get_Number_Players());
if (!teamName && team)
{
g_pVGuiLocalize->ConvertANSIToUnicode(team->Get_Name(), name, sizeof(name));
teamName = name;
}
if (team->Get_Number_Players() == 1)
{
g_pVGuiLocalize->ConstructString( string1, sizeof(string1), g_pVGuiLocalize->Find("#ScoreBoard_Player"), 2, teamName, wNumPlayers );
}
else
{
g_pVGuiLocalize->ConstructString( string1, sizeof(string1), g_pVGuiLocalize->Find("#ScoreBoard_Players"), 2, teamName, wNumPlayers );
}
// update stats
wchar_t val[6];
V_snwprintf(val, ARRAYSIZE(val), L"%d", team->Get_Score());
m_pPlayerList->ModifyColumn(sectionID, "frags", val);
if (team->Get_Ping() < 1)
{
m_pPlayerList->ModifyColumn(sectionID, "ping", L"");
}
else
{
V_snwprintf(val, ARRAYSIZE(val), L"%d", team->Get_Ping());
m_pPlayerList->ModifyColumn(sectionID, "ping", val);
}
}
m_pPlayerList->ModifyColumn(sectionID, "name", string1);
}
}
}
//-----------------------------------------------------------------------------
// Purpose: adds the top header of the scoreboars
//-----------------------------------------------------------------------------
void CHL2MPClientScoreBoardDialog::AddHeader()
{
// add the top header
m_pPlayerList->AddSection(0, "");
m_pPlayerList->SetSectionAlwaysVisible(0);
HFont hFallbackFont = scheme()->GetIScheme( GetScheme() )->GetFont( "DefaultVerySmallFallBack", false );
m_pPlayerList->AddColumnToSection(0, "name", "", 0, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_NAME_WIDTH ), hFallbackFont );
m_pPlayerList->AddColumnToSection(0, "class", "", 0, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_CLASS_WIDTH ) );
m_pPlayerList->AddColumnToSection(0, "frags", "#PlayerScore", 0 | SectionedListPanel::COLUMN_RIGHT, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_SCORE_WIDTH ) );
m_pPlayerList->AddColumnToSection(0, "deaths", "#PlayerDeath", 0 | SectionedListPanel::COLUMN_RIGHT, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_DEATH_WIDTH ) );
m_pPlayerList->AddColumnToSection(0, "ping", "#PlayerPing", 0 | SectionedListPanel::COLUMN_RIGHT, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_PING_WIDTH ) );
// m_pPlayerList->AddColumnToSection(0, "voice", "#PlayerVoice", SectionedListPanel::COLUMN_IMAGE | SectionedListPanel::HEADER_TEXT| SectionedListPanel::COLUMN_CENTER, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_VOICE_WIDTH ) );
// m_pPlayerList->AddColumnToSection(0, "tracker", "#PlayerTracker", SectionedListPanel::COLUMN_IMAGE | SectionedListPanel::HEADER_TEXT, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_FRIENDS_WIDTH ) );
}
//-----------------------------------------------------------------------------
// Purpose: Adds a new section to the scoreboard (i.e the team header)
//-----------------------------------------------------------------------------
void CHL2MPClientScoreBoardDialog::AddSection(int teamType, int teamNumber)
{
HFont hFallbackFont = scheme()->GetIScheme( GetScheme() )->GetFont( "DefaultVerySmallFallBack", false );
int sectionID = GetSectionFromTeamNumber( teamNumber );
if ( teamType == TYPE_TEAM )
{
m_pPlayerList->AddSection(sectionID, "", StaticPlayerSortFunc);
// setup the columns
m_pPlayerList->AddColumnToSection(sectionID, "name", "", 0, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_NAME_WIDTH ), hFallbackFont );
m_pPlayerList->AddColumnToSection(sectionID, "class", "" , 0, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_CLASS_WIDTH ) );
m_pPlayerList->AddColumnToSection(sectionID, "frags", "", SectionedListPanel::COLUMN_RIGHT, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_SCORE_WIDTH ) );
m_pPlayerList->AddColumnToSection(sectionID, "deaths", "", SectionedListPanel::COLUMN_RIGHT, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_DEATH_WIDTH ) );
m_pPlayerList->AddColumnToSection(sectionID, "ping", "", SectionedListPanel::COLUMN_RIGHT, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_PING_WIDTH ) );
// set the section to have the team color
if ( teamNumber )
{
if ( GameResources() )
m_pPlayerList->SetSectionFgColor(sectionID, GameResources()->GetTeamColor(teamNumber));
}
m_pPlayerList->SetSectionAlwaysVisible(sectionID);
}
else if ( teamType == TYPE_SPECTATORS )
{
m_pPlayerList->AddSection(sectionID, "");
m_pPlayerList->AddColumnToSection(sectionID, "name", "#Spectators", 0, scheme()->GetProportionalScaledValueEx( GetScheme(), CSTRIKE_NAME_WIDTH ), hFallbackFont );
m_pPlayerList->AddColumnToSection(sectionID, "class", "" , 0, scheme()->GetProportionalScaledValueEx( GetScheme(), 100 ) );
}
}
int CHL2MPClientScoreBoardDialog::GetSectionFromTeamNumber( int teamNumber )
{
switch ( teamNumber )
{
case TEAM_COMBINE:
return SCORESECTION_COMBINE;
case TEAM_REBELS:
return SCORESECTION_REBELS;
case TEAM_SPECTATOR:
return SCORESECTION_SPECTATOR;
default:
return SCORESECTION_FREEFORALL;
}
return SCORESECTION_FREEFORALL;
}
//-----------------------------------------------------------------------------
// Purpose: Adds a new row to the scoreboard, from the playerinfo structure
//-----------------------------------------------------------------------------
bool CHL2MPClientScoreBoardDialog::GetPlayerScoreInfo(int playerIndex, KeyValues *kv)
{
kv->SetInt("playerIndex", playerIndex);
kv->SetInt("team", g_PR->GetTeam( playerIndex ) );
kv->SetString("name", g_PR->GetPlayerName(playerIndex) );
kv->SetInt("deaths", g_PR->GetDeaths( playerIndex ));
kv->SetInt("frags", g_PR->GetPlayerScore( playerIndex ));
kv->SetString("class", "");
if (g_PR->GetPing( playerIndex ) < 1)
{
if ( g_PR->IsFakePlayer( playerIndex ) )
{
kv->SetString("ping", "BOT");
}
else
{
kv->SetString("ping", "");
}
}
else
{
kv->SetInt("ping", g_PR->GetPing( playerIndex ));
}
return true;
}
enum {
MAX_PLAYERS_PER_TEAM = 16,
MAX_SCOREBOARD_PLAYERS = 32
};
struct PlayerScoreInfo
{
int index;
int frags;
int deaths;
bool important;
bool alive;
};
int PlayerScoreInfoSort( const PlayerScoreInfo *p1, const PlayerScoreInfo *p2 )
{
// check local
if ( p1->important )
return -1;
if ( p2->important )
return 1;
// check alive
if ( p1->alive && !p2->alive )
return -1;
if ( p2->alive && !p1->alive )
return 1;
// check frags
if ( p1->frags > p2->frags )
return -1;
if ( p2->frags > p1->frags )
return 1;
// check deaths
if ( p1->deaths < p2->deaths )
return -1;
if ( p2->deaths < p1->deaths )
return 1;
// check index
if ( p1->index < p2->index )
return -1;
return 1;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHL2MPClientScoreBoardDialog::UpdatePlayerInfo()
{
m_iSectionId = 0; // 0'th row is a header
int selectedRow = -1;
int i;
CBasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
if ( !pPlayer || !g_PR )
return;
// walk all the players and make sure they're in the scoreboard
for ( i = 1; i <= gpGlobals->maxClients; i++ )
{
bool shouldShow = g_PR->IsConnected( i );
if ( shouldShow )
{
// add the player to the list
KeyValues *playerData = new KeyValues("data");
GetPlayerScoreInfo( i, playerData );
int itemID = FindItemIDForPlayerIndex( i );
int sectionID = GetSectionFromTeamNumber( g_PR->GetTeam( i ) );
if (itemID == -1)
{
// add a new row
itemID = m_pPlayerList->AddItem( sectionID, playerData );
}
else
{
// modify the current row
m_pPlayerList->ModifyItem( itemID, sectionID, playerData );
}
if ( i == pPlayer->entindex() )
{
selectedRow = itemID; // this is the local player, hilight this row
}
// set the row color based on the players team
m_pPlayerList->SetItemFgColor( itemID, g_PR->GetTeamColor( g_PR->GetTeam( i ) ) );
playerData->deleteThis();
}
else
{
// remove the player
int itemID = FindItemIDForPlayerIndex( i );
if (itemID != -1)
{
m_pPlayerList->RemoveItem(itemID);
}
}
}
if ( selectedRow != -1 )
{
m_pPlayerList->SetSelectedItem(selectedRow);
}
}

View File

@@ -0,0 +1,63 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef CHL2MPCLIENTSCOREBOARDDIALOG_H
#define CHL2MPCLIENTSCOREBOARDDIALOG_H
#ifdef _WIN32
#pragma once
#endif
#include <clientscoreboarddialog.h>
//-----------------------------------------------------------------------------
// Purpose: Game ScoreBoard
//-----------------------------------------------------------------------------
class CHL2MPClientScoreBoardDialog : public CClientScoreBoardDialog
{
private:
DECLARE_CLASS_SIMPLE(CHL2MPClientScoreBoardDialog, CClientScoreBoardDialog);
public:
CHL2MPClientScoreBoardDialog(IViewPort *pViewPort);
~CHL2MPClientScoreBoardDialog();
protected:
// scoreboard overrides
virtual void InitScoreboardSections();
virtual void UpdateTeamInfo();
virtual bool GetPlayerScoreInfo(int playerIndex, KeyValues *outPlayerInfo);
virtual void UpdatePlayerInfo();
// vgui overrides for rounded corner background
virtual void PaintBackground();
virtual void PaintBorder();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
private:
virtual void AddHeader(); // add the start header of the scoreboard
virtual void AddSection(int teamType, int teamNumber); // add a new section header for a team
int GetSectionFromTeamNumber( int teamNumber );
enum
{
CSTRIKE_NAME_WIDTH = 320,
CSTRIKE_CLASS_WIDTH = 56,
CSTRIKE_SCORE_WIDTH = 40,
CSTRIKE_DEATH_WIDTH = 46,
CSTRIKE_PING_WIDTH = 46,
// CSTRIKE_VOICE_WIDTH = 40,
// CSTRIKE_FRIENDS_WIDTH = 24,
};
// rounded corners
Color m_bgColor;
Color m_borderColor;
};
#endif // CHL2MPCLIENTSCOREBOARDDIALOG_H

View File

@@ -0,0 +1,117 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "poly_hud_chat.h"
#include "hud_macros.h"
#include "text_message.h"
#include "vguicenterprint.h"
#include "vgui/ILocalize.h"
#include "c_team.h"
#include "c_playerresource.h"
#include "c_poly_player.h"
#include "poly_gamerules.h"
#include "ihudlcd.h"
#pragma message("Polymorph Hud Chat")
DECLARE_HUDELEMENT( CHudChat );
DECLARE_HUD_MESSAGE( CHudChat, SayText );
DECLARE_HUD_MESSAGE( CHudChat, SayText2 );
DECLARE_HUD_MESSAGE( CHudChat, TextMsg );
//=====================
//CHudChatLine
//=====================
void CHudChatLine::ApplySchemeSettings(vgui::IScheme *pScheme)
{
BaseClass::ApplySchemeSettings( pScheme );
}
//=====================
//CHudChatInputLine
//=====================
void CHudChatInputLine::ApplySchemeSettings(vgui::IScheme *pScheme)
{
BaseClass::ApplySchemeSettings(pScheme);
}
//=====================
//CHudChat
//=====================
CHudChat::CHudChat( const char *pElementName ) : BaseClass( pElementName )
{
}
void CHudChat::CreateChatInputLine( void )
{
m_pChatInput = new CHudChatInputLine( this, "ChatInputLine" );
m_pChatInput->SetVisible( false );
}
void CHudChat::CreateChatLines( void )
{
m_ChatLine = new CHudChatLine( this, "ChatLine1" );
m_ChatLine->SetVisible( false );
}
void CHudChat::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
}
void CHudChat::Init( void )
{
BaseClass::Init();
HOOK_HUD_MESSAGE( CHudChat, SayText );
HOOK_HUD_MESSAGE( CHudChat, SayText2 );
HOOK_HUD_MESSAGE( CHudChat, TextMsg );
}
//-----------------------------------------------------------------------------
// Purpose: Overrides base reset to not cancel chat at round restart
//-----------------------------------------------------------------------------
void CHudChat::Reset( void )
{
}
int CHudChat::GetChatInputOffset( void )
{
if ( m_pChatInput->IsVisible() )
{
return m_iFontHeight;
}
else
return 0;
}
Color CHudChat::GetClientColor( int clientIndex )
{
if ( clientIndex == 0 ) // console msg
{
return g_ColorYellow;
}
else if( g_PR )
{
switch ( g_PR->GetTeam( clientIndex ) )
{
case TEAM_COMBINE : return g_ColorBlue;
case TEAM_REBELS : return g_ColorRed;
default : return g_ColorYellow;
}
}
return g_ColorYellow;
}

View File

@@ -0,0 +1,65 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef CS_HUD_CHAT_H
#define CS_HUD_CHAT_H
#ifdef _WIN32
#pragma once
#endif
#include <hud_basechat.h>
class CHudChatLine : public CBaseHudChatLine
{
DECLARE_CLASS_SIMPLE( CHudChatLine, CBaseHudChatLine );
public:
CHudChatLine( vgui::Panel *parent, const char *panelName ) : CBaseHudChatLine( parent, panelName ) {}
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
void MsgFunc_SayText(bf_read &msg);
private:
CHudChatLine( const CHudChatLine & ); // not defined, not accessible
};
//-----------------------------------------------------------------------------
// Purpose: The prompt and text entry area for chat messages
//-----------------------------------------------------------------------------
class CHudChatInputLine : public CBaseHudChatInputLine
{
DECLARE_CLASS_SIMPLE( CHudChatInputLine, CBaseHudChatInputLine );
public:
CHudChatInputLine( CBaseHudChat *parent, char const *panelName ) : CBaseHudChatInputLine( parent, panelName ) {}
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
};
class CHudChat : public CBaseHudChat
{
DECLARE_CLASS_SIMPLE( CHudChat, CBaseHudChat );
public:
CHudChat( const char *pElementName );
virtual void CreateChatInputLine( void );
virtual void CreateChatLines( void );
virtual void Init( void );
virtual void Reset( void );
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
int GetChatInputOffset( void );
virtual Color GetClientColor( int clientIndex );
};
#endif //CS_HUD_CHAT_H

View File

@@ -0,0 +1,222 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: HUD Target ID element
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "hud.h"
#include "hudelement.h"
#include "c_poly_player.h"
#include "c_playerresource.h"
#include "vgui_entitypanel.h"
#include "iclientmode.h"
#include "vgui/ILocalize.h"
#include "poly_gamerules.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#define PLAYER_HINT_DISTANCE 150
#define PLAYER_HINT_DISTANCE_SQ (PLAYER_HINT_DISTANCE*PLAYER_HINT_DISTANCE)
static ConVar hud_centerid( "hud_centerid", "1" );
static ConVar hud_showtargetid( "hud_showtargetid", "1" );
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CTargetID : public CHudElement, public vgui::Panel
{
DECLARE_CLASS_SIMPLE( CTargetID, vgui::Panel );
public:
CTargetID( const char *pElementName );
void Init( void );
virtual void ApplySchemeSettings( vgui::IScheme *scheme );
virtual void Paint( void );
void VidInit( void );
private:
Color GetColorForTargetTeam( int iTeamNumber );
vgui::HFont m_hFont;
int m_iLastEntIndex;
float m_flLastChangeTime;
};
DECLARE_HUDELEMENT( CTargetID );
using namespace vgui;
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CTargetID::CTargetID( const char *pElementName ) :
CHudElement( pElementName ), BaseClass( NULL, "TargetID" )
{
vgui::Panel *pParent = g_pClientMode->GetViewport();
SetParent( pParent );
m_hFont = g_hFontTrebuchet24;
m_flLastChangeTime = 0;
m_iLastEntIndex = 0;
SetHiddenBits( HIDEHUD_MISCSTATUS );
}
//-----------------------------------------------------------------------------
// Purpose: Setup
//-----------------------------------------------------------------------------
void CTargetID::Init( void )
{
};
void CTargetID::ApplySchemeSettings( vgui::IScheme *scheme )
{
BaseClass::ApplySchemeSettings( scheme );
m_hFont = scheme->GetFont( "TargetID", IsProportional() );
SetPaintBackgroundEnabled( false );
}
//-----------------------------------------------------------------------------
// Purpose: clear out string etc between levels
//-----------------------------------------------------------------------------
void CTargetID::VidInit()
{
CHudElement::VidInit();
m_flLastChangeTime = 0;
m_iLastEntIndex = 0;
}
Color CTargetID::GetColorForTargetTeam( int iTeamNumber )
{
return GameResources()->GetTeamColor( iTeamNumber );
}
//-----------------------------------------------------------------------------
// Purpose: Draw function for the element
//-----------------------------------------------------------------------------
void CTargetID::Paint()
{
#define MAX_ID_STRING 256
wchar_t sIDString[ MAX_ID_STRING ];
sIDString[0] = 0;
C_HL2MP_Player *pPlayer = C_HL2MP_Player::GetLocalHL2MPPlayer();
if ( !pPlayer )
return;
Color c;
// Get our target's ent index
int iEntIndex = pPlayer->GetIDTarget();
// Didn't find one?
if ( !iEntIndex )
{
// Check to see if we should clear our ID
if ( m_flLastChangeTime && (gpGlobals->curtime > (m_flLastChangeTime + 0.5)) )
{
m_flLastChangeTime = 0;
sIDString[0] = 0;
m_iLastEntIndex = 0;
}
else
{
// Keep re-using the old one
iEntIndex = m_iLastEntIndex;
}
}
else
{
m_flLastChangeTime = gpGlobals->curtime;
}
// Is this an entindex sent by the server?
if ( iEntIndex )
{
C_BasePlayer *pPlayer = static_cast<C_BasePlayer*>(cl_entitylist->GetEnt( iEntIndex ));
C_BasePlayer *pLocalPlayer = C_BasePlayer::GetLocalPlayer();
const char *printFormatString = NULL;
wchar_t wszPlayerName[ MAX_PLAYER_NAME_LENGTH ];
wchar_t wszHealthText[ 10 ];
bool bShowHealth = false;
bool bShowPlayerName = false;
// Some entities we always want to check, cause the text may change
// even while we're looking at it
// Is it a player?
if ( IsPlayerIndex( iEntIndex ) )
{
c = GetColorForTargetTeam( pPlayer->GetTeamNumber() );
bShowPlayerName = true;
g_pVGuiLocalize->ConvertANSIToUnicode( pPlayer->GetPlayerName(), wszPlayerName, sizeof(wszPlayerName) );
if ( HL2MPRules()->IsTeamplay() == true && pPlayer->InSameTeam(pLocalPlayer) )
{
printFormatString = "#Playerid_sameteam";
bShowHealth = true;
}
else
{
printFormatString = "#Playerid_diffteam";
}
if ( bShowHealth )
{
_snwprintf( wszHealthText, ARRAYSIZE(wszHealthText) - 1, L"%.0f%%", ((float)pPlayer->GetHealth() / (float)pPlayer->GetMaxHealth() ) );
wszHealthText[ ARRAYSIZE(wszHealthText)-1 ] = '\0';
}
}
if ( printFormatString )
{
if ( bShowPlayerName && bShowHealth )
{
g_pVGuiLocalize->ConstructString( sIDString, sizeof(sIDString), g_pVGuiLocalize->Find(printFormatString), 2, wszPlayerName, wszHealthText );
}
else if ( bShowPlayerName )
{
g_pVGuiLocalize->ConstructString( sIDString, sizeof(sIDString), g_pVGuiLocalize->Find(printFormatString), 1, wszPlayerName );
}
else if ( bShowHealth )
{
g_pVGuiLocalize->ConstructString( sIDString, sizeof(sIDString), g_pVGuiLocalize->Find(printFormatString), 1, wszHealthText );
}
else
{
g_pVGuiLocalize->ConstructString( sIDString, sizeof(sIDString), g_pVGuiLocalize->Find(printFormatString), 0 );
}
}
if ( sIDString[0] )
{
int wide, tall;
int ypos = YRES(260);
int xpos = XRES(10);
vgui::surface()->GetTextSize( m_hFont, sIDString, wide, tall );
if( hud_centerid.GetInt() == 0 )
{
ypos = YRES(420);
}
else
{
xpos = (ScreenWidth() - wide) / 2;
}
vgui::surface()->DrawSetTextFont( m_hFont );
vgui::surface()->DrawSetTextPos( xpos, ypos );
vgui::surface()->DrawSetTextColor( c );
vgui::surface()->DrawPrintText( sIDString, wcslen(sIDString) );
}
}
}

View File

@@ -0,0 +1,189 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: HUD Target ID element
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "hud.h"
#include "hudelement.h"
#include "c_poly_player.h"
#include "c_playerresource.h"
#include "vgui_entitypanel.h"
#include "iclientmode.h"
#include "vgui/ILocalize.h"
#include "poly_gamerules.h"
#include "c_team.h"
#include <vgui_controls/AnimationController.h>
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
// Purpose: Displays current ammunition level
//-----------------------------------------------------------------------------
class CTeamPlayHud : public vgui::Panel, public CHudElement
{
DECLARE_CLASS_SIMPLE( CTeamPlayHud, vgui::Panel );
public:
CTeamPlayHud( const char *pElementName );
void Reset();
virtual void PerformLayout();
protected:
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void OnThink();
private:
vgui::HFont m_hFont;
Color m_bgColor;
vgui::Label *m_pWarmupLabel; // "Warmup Mode"
vgui::Label *m_pBackground; // black box
bool m_bSuitAuxPowerUsed;
CPanelAnimationVarAliasType( int, m_iTextX, "text_xpos", "8", "proportional_int" );
CPanelAnimationVarAliasType( int, m_iTextY, "text_ypos", "8", "proportional_int" );
};
DECLARE_HUDELEMENT( CTeamPlayHud );
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CTeamPlayHud::CTeamPlayHud( const char *pElementName ) : BaseClass(NULL, "TeamDisplay"), CHudElement( pElementName )
{
vgui::Panel *pParent = g_pClientMode->GetViewport();
SetParent( pParent );
SetVisible( false );
SetAlpha( 255 );
m_pBackground = new vgui::Label( this, "Background", "" );
m_pWarmupLabel = new vgui::Label( this, "RoundState_warmup", "test label" /*g_pVGuiLocalize->Find( "#Clan_warmup_mode" )*/ );
m_pWarmupLabel->SetPaintBackgroundEnabled( false );
m_pWarmupLabel->SetPaintBorderEnabled( false );
m_pWarmupLabel->SizeToContents();
m_pWarmupLabel->SetContentAlignment( vgui::Label::a_west );
m_pWarmupLabel->SetFgColor( GetFgColor() );
m_bSuitAuxPowerUsed = false;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTeamPlayHud::Reset()
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTeamPlayHud::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
SetFgColor( Color(0,0,0,0) ); //GetSchemeColor("RoundStateFg", pScheme) );
m_hFont = pScheme->GetFont( "Default", true );
m_pBackground->SetBgColor( GetSchemeColor("BgColor", pScheme) );
m_pBackground->SetPaintBackgroundType( 2 );
SetAlpha( 255 );
SetBgColor( Color( 0, 0, 0, 0 ) );
SetPaintBackgroundType( 0 );
}
//-----------------------------------------------------------------------------
// Purpose: Resizes the label
//-----------------------------------------------------------------------------
void CTeamPlayHud::PerformLayout()
{
BaseClass::PerformLayout();
int wide, tall;
GetSize( wide, tall );
// find the widest line
int labelWide = m_pWarmupLabel->GetWide();
// find the total height
int fontTall = vgui::surface()->GetFontTall( m_hFont );
int labelTall = fontTall;
labelWide += m_iTextX*2;
labelTall += m_iTextY*2;
m_pBackground->SetBounds( 0, 0, labelWide, labelTall );
int xOffset = (labelWide - m_pWarmupLabel->GetWide())/2;
m_pWarmupLabel->SetPos( 0 + xOffset, 0 + m_iTextY );
}
//-----------------------------------------------------------------------------
// Purpose: Updates the label color each frame
//-----------------------------------------------------------------------------
void CTeamPlayHud::OnThink()
{
SetVisible( false );
C_BaseHLPlayer *pLocalPlayer = (C_BaseHLPlayer *)C_BasePlayer::GetLocalPlayer();
if ( pLocalPlayer == NULL )
return;
if ( HL2MPRules()->IsTeamplay() == false )
return;
if ( pLocalPlayer->IsAlive() == false )
return;
if ( pLocalPlayer->m_HL2Local.m_flSuitPower < 100 )
{
if ( m_bSuitAuxPowerUsed == false )
{
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("FadeOutTeamLine");
m_bSuitAuxPowerUsed = true;
}
}
else
{
if ( m_bSuitAuxPowerUsed == true )
{
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("FadeInTeamLine");
m_bSuitAuxPowerUsed = false;
}
}
int iTeamNumber = pLocalPlayer->GetTeamNumber();
Color c = GameResources()->GetTeamColor( iTeamNumber );
wchar_t string1[1024];
C_Team *pTeam = GetGlobalTeam( iTeamNumber );
if ( pTeam )
{
wchar_t TeamName[64];
g_pVGuiLocalize->ConvertANSIToUnicode( pTeam->Get_Name(), TeamName, sizeof(TeamName) );
g_pVGuiLocalize->ConstructString( string1, sizeof(string1), g_pVGuiLocalize->Find("#Team"), 1, TeamName );
m_pBackground->SetFgColor( GetFgColor() );
m_pWarmupLabel->SetFgColor(c);
m_pWarmupLabel->SetText( string1 );
m_pWarmupLabel->SetVisible( true );
m_pWarmupLabel->SizeToContents();
SetVisible( true );
}
InvalidateLayout();
}

View File

@@ -0,0 +1,174 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "poly_textwindow.h"
#include "backgroundpanel.h"
#include <cdll_client_int.h>
#include <vgui/IScheme.h>
#include <vgui/ILocalize.h>
#include <vgui/ISurface.h>
#include <filesystem.h>
#include <KeyValues.h>
#include <convar.h>
#include <vgui_controls/ImageList.h>
#include <vgui_controls/TextEntry.h>
#include <vgui_controls/Button.h>
#include <vgui_controls/BuildGroup.h>
#include "IGameUIFuncs.h" // for key bindings
#include <igameresources.h>
extern IGameUIFuncs *gameuifuncs; // for key binding details
#include <game/client/iviewport.h>
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
using namespace vgui;
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CHL2MPTextWindow::CHL2MPTextWindow(IViewPort *pViewPort) : CTextWindow( pViewPort )
{
SetProportional( true );
m_iScoreBoardKey = BUTTON_CODE_INVALID; // this is looked up in Activate()
CreateBackground( this );
m_backgroundLayoutFinished = false;
}
//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
CHL2MPTextWindow::~CHL2MPTextWindow()
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHL2MPTextWindow::Update()
{
BaseClass::Update();
m_pOK->RequestFocus();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHL2MPTextWindow::SetVisible(bool state)
{
BaseClass::SetVisible(state);
if ( state )
{
m_pOK->RequestFocus();
}
}
//-----------------------------------------------------------------------------
// Purpose: shows the text window
//-----------------------------------------------------------------------------
void CHL2MPTextWindow::ShowPanel(bool bShow)
{
if ( bShow )
{
// get key binding if shown
if ( m_iScoreBoardKey == BUTTON_CODE_INVALID ) // you need to lookup the jump key AFTER the engine has loaded
{
m_iScoreBoardKey = gameuifuncs->GetButtonCodeForBind( "showscores" );
}
}
BaseClass::ShowPanel( bShow );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHL2MPTextWindow::OnKeyCodePressed(KeyCode code)
{
if ( m_iScoreBoardKey != BUTTON_CODE_INVALID && m_iScoreBoardKey == code )
{
gViewPortInterface->ShowPanel( PANEL_SCOREBOARD, true );
gViewPortInterface->PostMessageToPanel( PANEL_SCOREBOARD, new KeyValues( "PollHideCode", "code", code ) );
}
else
{
BaseClass::OnKeyCodePressed( code );
}
}
//-----------------------------------------------------------------------------
// Purpose: The CS background is painted by image panels, so we should do nothing
//-----------------------------------------------------------------------------
void CHL2MPTextWindow::PaintBackground()
{
}
//-----------------------------------------------------------------------------
// Purpose: Scale / center the window
//-----------------------------------------------------------------------------
void CHL2MPTextWindow::PerformLayout()
{
BaseClass::PerformLayout();
// stretch the window to fullscreen
if ( !m_backgroundLayoutFinished )
LayoutBackgroundPanel( this );
m_backgroundLayoutFinished = true;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHL2MPTextWindow::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
ApplyBackgroundSchemeSettings( this, pScheme );
}
CHL2MPSpectatorGUI::CHL2MPSpectatorGUI(IViewPort *pViewPort) : CSpectatorGUI(pViewPort)
{
}
bool CHL2MPSpectatorGUI::NeedsUpdate( void )
{
if ( !C_BasePlayer::GetLocalPlayer() )
return false;
if ( m_nLastSpecMode != C_BasePlayer::GetLocalPlayer()->GetObserverMode() )
return true;
if ( m_nLastSpecTarget != C_BasePlayer::GetLocalPlayer()->GetObserverTarget() )
return true;
return BaseClass::NeedsUpdate();
}
void CHL2MPSpectatorGUI::Update()
{
BaseClass::Update();
C_BasePlayer *pLocalPlayer = C_BasePlayer::GetLocalPlayer();
if( pLocalPlayer )
{
m_nLastSpecMode = pLocalPlayer->GetObserverMode();
m_nLastSpecTarget = pLocalPlayer->GetObserverTarget();
}
}

View File

@@ -0,0 +1,67 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef CSTEXTWINDOW_H
#define CSTEXTWINDOW_H
#ifdef _WIN32
#pragma once
#endif
#include "vguitextwindow.h"
#include <spectatorgui.h>
//-----------------------------------------------------------------------------
// Purpose: displays the MOTD
//-----------------------------------------------------------------------------
class CHL2MPTextWindow : public CTextWindow
{
private:
DECLARE_CLASS_SIMPLE( CHL2MPTextWindow, CTextWindow );
public:
CHL2MPTextWindow(IViewPort *pViewPort);
virtual ~CHL2MPTextWindow();
virtual void Update();
virtual void SetVisible(bool state);
virtual void ShowPanel( bool bShow );
virtual void OnKeyCodePressed(vgui::KeyCode code);
protected:
ButtonCode_t m_iScoreBoardKey;
// Background panel -------------------------------------------------------
public:
virtual void PaintBackground();
virtual void PerformLayout();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
bool m_backgroundLayoutFinished;
// End background panel ---------------------------------------------------
};
class CHL2MPSpectatorGUI : public CSpectatorGUI
{
private:
DECLARE_CLASS_SIMPLE( CHL2MPSpectatorGUI, CSpectatorGUI );
public:
CHL2MPSpectatorGUI( IViewPort *pViewPort );
virtual void Update( void );
virtual bool NeedsUpdate( void );
protected:
int m_nLastSpecMode;
CBaseEntity *m_nLastSpecTarget;
};
#endif // CSTEXTWINDOW_H

View File

@@ -59,6 +59,9 @@
#include "c_prop_portal.h" //portal surface rendering functions #include "c_prop_portal.h" //portal surface rendering functions
#endif #endif
//#ifdef POLY
#include "c_poly_player.h"
//#endif
// memdbgon must be the last include file in a .cpp file!!! // memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h" #include "tier0/memdbgon.h"
@@ -683,6 +686,19 @@ void CViewRender::SetUpViews()
// FIXME: What happens when there's no player? // FIXME: What happens when there's no player?
if (pPlayer) if (pPlayer)
{ {
// #ifdef POLY
C_HL2MP_Player* pPolyPlayer = (C_HL2MP_Player*)pPlayer;
if(pPolyPlayer)
{
float scale = (float)(pPolyPlayer->GetPolyLocal().m_iPolyLevel+1) / MAX_POLYLEVEL;
view.zNear = GetZNear() * scale;
view.zNearViewmodel = scale;
view.zFar = GetZFar() * scale;
view.zFarViewmodel = GetZFar() * scale;
}
// #endif
pPlayer->CalcView( view.origin, view.angles, view.zNear, view.zFar, view.fov ); pPlayer->CalcView( view.origin, view.angles, view.zNear, view.zFar, view.fov );
// If we are looking through another entities eyes, then override the angles/origin for view // If we are looking through another entities eyes, then override the angles/origin for view

View File

@@ -269,6 +269,7 @@ IMPLEMENT_SERVERCLASS_ST_NOBASE( CBaseEntity, DT_BaseEntity )
#endif #endif
SendPropInt (SENDINFO( m_ubInterpolationFrame ), NOINTERP_PARITY_MAX_BITS, SPROP_UNSIGNED ), SendPropInt (SENDINFO( m_ubInterpolationFrame ), NOINTERP_PARITY_MAX_BITS, SPROP_UNSIGNED ),
SendPropBool (SENDINFO( m_bForceNoInterpolate )),
SendPropModelIndex(SENDINFO(m_nModelIndex)), SendPropModelIndex(SENDINFO(m_nModelIndex)),
SendPropDataTable( SENDINFO_DT( m_Collision ), &REFERENCE_SEND_TABLE(DT_CollisionProperty) ), SendPropDataTable( SENDINFO_DT( m_Collision ), &REFERENCE_SEND_TABLE(DT_CollisionProperty) ),
SendPropInt (SENDINFO(m_nRenderFX), 8, SPROP_UNSIGNED ), SendPropInt (SENDINFO(m_nRenderFX), 8, SPROP_UNSIGNED ),

View File

@@ -814,6 +814,9 @@ public:
CNetworkVar( int, m_ubInterpolationFrame ); CNetworkVar( int, m_ubInterpolationFrame );
CNetworkVar( bool, m_bForceNoInterpolate );
int m_nLastThinkTick; int m_nLastThinkTick;
#if !defined( NO_ENTITY_PREDICTION ) #if !defined( NO_ENTITY_PREDICTION )

View File

@@ -35,11 +35,9 @@ ConVar falldamage( "mp_falldamage","0", FCVAR_NOTIFY );
ConVar weaponstay( "mp_weaponstay","0", FCVAR_NOTIFY ); ConVar weaponstay( "mp_weaponstay","0", FCVAR_NOTIFY );
ConVar forcerespawn( "mp_forcerespawn","1", FCVAR_NOTIFY ); ConVar forcerespawn( "mp_forcerespawn","1", FCVAR_NOTIFY );
ConVar footsteps( "mp_footsteps","1", FCVAR_NOTIFY ); ConVar footsteps( "mp_footsteps","1", FCVAR_NOTIFY );
#ifdef CSTRIKE
ConVar flashlight( "mp_flashlight","1", FCVAR_NOTIFY ); ConVar flashlight( "mp_flashlight","1", FCVAR_NOTIFY );
#else
ConVar flashlight( "mp_flashlight","0", FCVAR_NOTIFY );
#endif
ConVar aimcrosshair( "mp_autocrosshair","1", FCVAR_NOTIFY ); ConVar aimcrosshair( "mp_autocrosshair","1", FCVAR_NOTIFY );
ConVar decalfrequency( "decalfrequency","10", FCVAR_NOTIFY ); ConVar decalfrequency( "decalfrequency","10", FCVAR_NOTIFY );
ConVar teamlist( "mp_teamlist","hgrunt;scientist", FCVAR_NOTIFY ); ConVar teamlist( "mp_teamlist","hgrunt;scientist", FCVAR_NOTIFY );

View File

@@ -594,7 +594,7 @@ CBasePlayer::CBasePlayer( )
m_hZoomOwner = NULL; m_hZoomOwner = NULL;
m_nUpdateRate = 20; // cl_updaterate defualt m_nUpdateRate = 20; // cl_updaterate defualt
m_fLerpTime = 0.1f; // cl_interp default m_fLerpTime = 0.025f; // cl_interp default
m_bPredictWeapons = true; m_bPredictWeapons = true;
m_bLagCompensation = false; m_bLagCompensation = false;
m_flLaggedMovementValue = 1.0f; m_flLaggedMovementValue = 1.0f;
@@ -639,6 +639,8 @@ CBasePlayer::CBasePlayer( )
m_flMovementTimeForUserCmdProcessingRemaining = 0.0f; m_flMovementTimeForUserCmdProcessingRemaining = 0.0f;
m_flLastObjectiveTime = -1.f; m_flLastObjectiveTime = -1.f;
m_flAccelerationSpeed = sv_accelerate.GetFloat();
} }
CBasePlayer::~CBasePlayer( ) CBasePlayer::~CBasePlayer( )
@@ -8014,6 +8016,7 @@ void SendProxy_CropFlagsToPlayerFlagBitsLength( const SendProp *pProp, const voi
SendPropEHandle (SENDINFO(m_hZoomOwner) ), SendPropEHandle (SENDINFO(m_hZoomOwner) ),
SendPropArray ( SendPropEHandle( SENDINFO_ARRAY( m_hViewModel ) ), m_hViewModel ), SendPropArray ( SendPropEHandle( SENDINFO_ARRAY( m_hViewModel ) ), m_hViewModel ),
SendPropString (SENDINFO(m_szLastPlaceName) ), SendPropString (SENDINFO(m_szLastPlaceName) ),
SendPropFloat (SENDINFO(m_flAccelerationSpeed)),
#if defined USES_ECON_ITEMS #if defined USES_ECON_ITEMS
SendPropUtlVector( SENDINFO_UTLVECTOR( m_hMyWearables ), MAX_WEARABLES_SENT_FROM_SERVER, SendPropEHandle( NULL, 0 ) ), SendPropUtlVector( SENDINFO_UTLVECTOR( m_hMyWearables ), MAX_WEARABLES_SENT_FROM_SERVER, SendPropEHandle( NULL, 0 ) ),

View File

@@ -622,6 +622,10 @@ public:
#endif #endif
public: public:
float GetAcceleration() { return m_flAccelerationSpeed; }
void SetAcceleration(float acc) { m_flAccelerationSpeed = acc; }
// Player Physics Shadow // Player Physics Shadow
void SetupVPhysicsShadow( const Vector &vecAbsOrigin, const Vector &vecAbsVelocity, CPhysCollide *pStandModel, const char *pStandHullName, CPhysCollide *pCrouchModel, const char *pCrouchHullName ); void SetupVPhysicsShadow( const Vector &vecAbsOrigin, const Vector &vecAbsVelocity, CPhysCollide *pStandModel, const char *pStandHullName, CPhysCollide *pCrouchModel, const char *pCrouchHullName );
IPhysicsPlayerController* GetPhysicsController() { return m_pPhysicsController; } IPhysicsPlayerController* GetPhysicsController() { return m_pPhysicsController; }
@@ -902,8 +906,13 @@ private:
Activity m_Activity; Activity m_Activity;
float m_flLastObjectiveTime; // Last curtime player touched/killed something the gamemode considers an objective float m_flLastObjectiveTime; // Last curtime player touched/killed something the gamemode considers an objective
CNetworkVar( float, m_flAccelerationSpeed);
protected: protected:
void CalcPlayerView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov ); void CalcPlayerView( Vector& eyeOrigin, QAngle& eyeAngles, float& fov );
void CalcVehicleView( IServerVehicle *pVehicle, Vector& eyeOrigin, QAngle& eyeAngles, void CalcVehicleView( IServerVehicle *pVehicle, Vector& eyeOrigin, QAngle& eyeAngles,
float& zNear, float& zFar, float& fov ); float& zNear, float& zFar, float& fov );
@@ -1176,13 +1185,13 @@ protected:
// Texture names and surface data, used by CGameMovement // Texture names and surface data, used by CGameMovement
int m_surfaceProps; int m_surfaceProps;
surfacedata_t* m_pSurfaceData; surfacedata_t* m_pSurfaceData;
float m_surfaceFriction;
char m_chTextureType; char m_chTextureType;
char m_chPreviousTextureType; // Separate from m_chTextureType. This is cleared if the player's not on the ground. char m_chPreviousTextureType; // Separate from m_chTextureType. This is cleared if the player's not on the ground.
bool m_bSinglePlayerGameEnding; bool m_bSinglePlayerGameEnding;
public: public:
float m_surfaceFriction;
float GetLaggedMovementValue( void ){ return m_flLaggedMovementValue; } float GetLaggedMovementValue( void ){ return m_flLaggedMovementValue; }
void SetLaggedMovementValue( float flValue ) { m_flLaggedMovementValue = flValue; } void SetLaggedMovementValue( float flValue ) { m_flLaggedMovementValue = flValue; }

View File

@@ -0,0 +1,184 @@
#include "cbase.h"
#include "props.h"
#include "poly_player.h"
#include "triggers.h"
class CPolyExpTrigger;
///
/// Interface for exp item stuff
///
class IExpItem
{
public:
virtual void MarkAsTouchedBy(CBaseEntity* pOther)
{
if (!AlreadyGrabbedBySomeone)
{
CHL2MP_Player* loc = ToHL2MPPlayer(pOther);
loc->AddExperience(EXP_PER_CUBE);
AlreadyGrabbedBySomeone = true;
UTIL_Remove(dynamic_cast<CBaseEntity*>(this));
}
}
bool AlreadyGrabbedBySomeone;
};
//
// Exp item with physics
//
class CExpItemPhys : public CPhysicsProp, public IExpItem
{
DECLARE_CLASS(CExpItemPhys, CPhysicsProp);
public:
CExpItemPhys()
{
AlreadyGrabbedBySomeone = false;
}
~CExpItemPhys()
{
if (m_trigger)
UTIL_Remove((CBaseEntity*)m_trigger);
}
void Spawn();
int OnTakeDamage(const CTakeDamageInfo& info)
{
return 0;
}
protected:
CPolyExpTrigger* m_trigger;
};
//
// Exp item without physics
//
class CExpItem : public CBaseAnimating, public IExpItem
{
DECLARE_CLASS(CExpItem, CBaseAnimating);
public:
CExpItem()
{
AlreadyGrabbedBySomeone = false;
}
~CExpItem()
{
if (m_trigger)
UTIL_Remove((CBaseEntity*)m_trigger);
}
void Spawn();
protected:
CPolyExpTrigger* m_trigger;
};
LINK_ENTITY_TO_CLASS(exp_item_phys, CExpItemPhys);
LINK_ENTITY_TO_CLASS(exp_item, CExpItem);
///
/// Trigger for Exp item
///
class CPolyExpTrigger : public CBaseTrigger
{
public:
DECLARE_CLASS(CPolyExpTrigger, CBaseTrigger);
DECLARE_DATADESC();
static CPolyExpTrigger* Create(const Vector& vecOrigin, const QAngle& vecAngles, const Vector& vecMins, const Vector& vecMaxs, CBaseEntity* pOwner)
{
CPolyExpTrigger* pTrigger = (CPolyExpTrigger*)CreateEntityByName("trigger_poly_exp_item");
if (pTrigger == NULL)
return NULL;
UTIL_SetOrigin(pTrigger, vecOrigin);
pTrigger->SetAbsAngles(vecAngles);
UTIL_SetSize(pTrigger, vecMins, vecMaxs);
DispatchSpawn(pTrigger);
pTrigger->SetParent(pOwner);
pTrigger->m_pOwner = dynamic_cast<IExpItem*>(pOwner);
return pTrigger;
}
virtual bool PassesTriggerFilters(CBaseEntity* pOther)
{
// did a player touch me?
if (pOther->IsPlayer())
return true;
// failed filter check
return false;
}
virtual void StartTouch(CBaseEntity* pOther)
{
if (pOther->IsPlayer())
{
m_pOwner->MarkAsTouchedBy(pOther);
}
//BaseClass::StartTouch(pOther);
}
void Spawn(void)
{
// Setup our basic attributes
SetMoveType(MOVETYPE_NONE);
SetSolid(SOLID_OBB);
SetSolidFlags(FSOLID_NOT_SOLID | FSOLID_TRIGGER);
AddSpawnFlags(SF_TRIGGER_ALLOW_CLIENTS);
BaseClass::Spawn();
}
protected:
IExpItem* m_pOwner;
};
LINK_ENTITY_TO_CLASS(trigger_poly_exp_item, CPolyExpTrigger);
BEGIN_DATADESC(CPolyExpTrigger)
DEFINE_FIELD(m_pOwner, FIELD_CLASSPTR),
END_DATADESC()
// ignore that stuff ^
void CExpItemPhys::Spawn()
{
PrecacheModel("models/props_junk/cardboard_box001a.mdl");
SetModel("models/props_junk/cardboard_box001a.mdl");
BaseClass::BaseClass::Spawn();
CreateVPhysics();
SetCollisionGroup(COLLISION_GROUP_DEBRIS);
Vector mins, maxs;
ExtractBbox(GetSequence(), mins, maxs);
m_trigger = CPolyExpTrigger::Create(GetAbsOrigin(), QAngle(0, 0, 0), mins, maxs, this);
CalculateBlockLOS();
}
void CExpItem::Spawn()
{
PrecacheModel("models/props_junk/cardboard_box001a.mdl");
SetModel("models/props_junk/cardboard_box001a.mdl");
BaseClass::Spawn();
Vector mins, maxs;
ExtractBbox(GetSequence(), mins, maxs);
m_trigger = CPolyExpTrigger::Create(GetAbsOrigin(), QAngle(0, 0, 0), mins, maxs, this);
}

View File

@@ -0,0 +1,197 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
/*
===== tf_client.cpp ========================================================
HL2 client/server game specific stuff
*/
#include "cbase.h"
#include "poly_player.h"
#include "poly_gamerules.h"
#include "gamerules.h"
#include "teamplay_gamerules.h"
#include "entitylist.h"
#include "physics.h"
#include "game.h"
#include "player_resource.h"
#include "engine/IEngineSound.h"
#include "team.h"
#include "viewport_panel_names.h"
#include "tier0/vprof.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
void Host_Say( edict_t *pEdict, bool teamonly );
ConVar sv_motd_unload_on_dismissal( "sv_motd_unload_on_dismissal", "0", 0, "If enabled, the MOTD contents will be unloaded when the player closes the MOTD." );
extern CBaseEntity* FindPickerEntityClass( CBasePlayer *pPlayer, char *classname );
extern bool g_fGameOver;
void FinishClientPutInServer( CHL2MP_Player *pPlayer )
{
pPlayer->InitialSpawn();
pPlayer->Spawn();
char sName[128];
Q_strncpy( sName, pPlayer->GetPlayerName(), sizeof( sName ) );
// First parse the name and remove any %'s
for ( char *pApersand = sName; pApersand != NULL && *pApersand != 0; pApersand++ )
{
// Replace it with a space
if ( *pApersand == '%' )
*pApersand = ' ';
}
// notify other clients of player joining the game
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, "#Game_connected", sName[0] != 0 ? sName : "<unconnected>" );
if ( HL2MPRules()->IsTeamplay() == true )
{
ClientPrint( pPlayer, HUD_PRINTTALK, "You are on team %s1\n", pPlayer->GetTeam()->GetName() );
}
const ConVar *hostname = cvar->FindVar( "hostname" );
const char *title = (hostname) ? hostname->GetString() : "MESSAGE OF THE DAY";
KeyValues *data = new KeyValues("data");
data->SetString( "title", title ); // info panel title
data->SetString( "type", "1" ); // show userdata from stringtable entry
data->SetString( "msg", "motd" ); // use this stringtable entry
data->SetBool( "unload", sv_motd_unload_on_dismissal.GetBool() );
pPlayer->ShowViewPortPanel( PANEL_INFO, true, data );
data->deleteThis();
}
/*
===========
ClientPutInServer
called each time a player is spawned into the game
============
*/
void ClientPutInServer( edict_t *pEdict, const char *playername )
{
// Allocate a CBaseTFPlayer for pev, and call spawn
CHL2MP_Player *pPlayer = CHL2MP_Player::CreatePlayer( "player", pEdict );
pPlayer->SetPlayerName( playername );
}
void ClientActive( edict_t *pEdict, bool bLoadGame )
{
// Can't load games in CS!
Assert( !bLoadGame );
CHL2MP_Player *pPlayer = ToHL2MPPlayer( CBaseEntity::Instance( pEdict ) );
FinishClientPutInServer( pPlayer );
}
/*
===============
const char *GetGameDescription()
Returns the descriptive name of this .dll. E.g., Half-Life, or Team Fortress 2
===============
*/
const char *GetGameDescription()
{
if ( g_pGameRules ) // this function may be called before the world has spawned, and the game rules initialized
return g_pGameRules->GetGameDescription();
else
return "Half-Life 2 Deathmatch";
}
//-----------------------------------------------------------------------------
// Purpose: Given a player and optional name returns the entity of that
// classname that the player is nearest facing
//
// Input :
// Output :
//-----------------------------------------------------------------------------
CBaseEntity* FindEntity( edict_t *pEdict, char *classname)
{
// If no name was given set bits based on the picked
if (FStrEq(classname,""))
{
return (FindPickerEntityClass( static_cast<CBasePlayer*>(GetContainingEntity(pEdict)), classname ));
}
return NULL;
}
//-----------------------------------------------------------------------------
// Purpose: Precache game-specific models & sounds
//-----------------------------------------------------------------------------
void ClientGamePrecache( void )
{
CBaseEntity::PrecacheModel("models/player.mdl");
CBaseEntity::PrecacheModel( "models/gibs/agibs.mdl" );
CBaseEntity::PrecacheModel ("models/weapons/v_hands.mdl");
CBaseEntity::PrecacheScriptSound( "HUDQuickInfo.LowAmmo" );
CBaseEntity::PrecacheScriptSound( "HUDQuickInfo.LowHealth" );
CBaseEntity::PrecacheScriptSound( "FX_AntlionImpact.ShellImpact" );
CBaseEntity::PrecacheScriptSound( "Missile.ShotDown" );
CBaseEntity::PrecacheScriptSound( "Bullets.DefaultNearmiss" );
CBaseEntity::PrecacheScriptSound( "Bullets.GunshipNearmiss" );
CBaseEntity::PrecacheScriptSound( "Bullets.StriderNearmiss" );
CBaseEntity::PrecacheScriptSound( "Geiger.BeepHigh" );
CBaseEntity::PrecacheScriptSound( "Geiger.BeepLow" );
}
// called by ClientKill and DeadThink
void respawn( CBaseEntity *pEdict, bool fCopyCorpse )
{
CHL2MP_Player *pPlayer = ToHL2MPPlayer( pEdict );
if ( pPlayer )
{
//if ( gpGlobals->curtime > pPlayer->GetDeathTime() + DEATH_ANIMATION_TIME )
{
// respawn player
pPlayer->Spawn();
}
}
}
void GameStartFrame( void )
{
VPROF("GameStartFrame()");
if ( g_fGameOver )
return;
gpGlobals->teamplay = (teamplay.GetInt() != 0);
#ifdef DEBUG
extern void Bot_RunAll();
Bot_RunAll();
#endif
}
//=========================================================
// instantiate the proper game rules object
//=========================================================
void InstallGameRules()
{
// vanilla deathmatch
CreateGameRulesObject( "CHL2MPRules" );
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,190 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#ifdef HL2MP_PLAYER_H
#pragma once
#else
#define HL2MP_PLAYER_H
class CHL2MP_Player;
#include "basemultiplayerplayer.h"
#include "poly_playerlocaldata.h"
#include "hl2_playerlocaldata.h"
#include "hl2_player.h"
#include "simtimer.h"
#include "soundenvelope.h"
#include "poly_player_shared.h"
#include "poly_gamerules.h"
#include "utldict.h"
//=============================================================================
// >> HL2MP_Player
//=============================================================================
class CHL2MPPlayerStateInfo
{
public:
HL2MPPlayerState m_iPlayerState;
const char *m_pStateName;
void (CHL2MP_Player::*pfnEnterState)(); // Init and deinit the state.
void (CHL2MP_Player::*pfnLeaveState)();
void (CHL2MP_Player::*pfnPreThink)(); // Do a PreThink() in this state.
};
class CHL2MP_Player : public CHL2_Player
{
public:
DECLARE_CLASS( CHL2MP_Player, CHL2_Player );
CHL2MP_Player();
~CHL2MP_Player( void );
static CHL2MP_Player *CreatePlayer( const char *className, edict_t *ed )
{
CHL2MP_Player::s_PlayerEdict = ed;
return (CHL2MP_Player*)CreateEntityByName( className );
}
DECLARE_SERVERCLASS();
DECLARE_DATADESC();
virtual void Precache( void );
virtual void Spawn( void );
virtual void PostThink( void );
virtual void PreThink( void );
virtual void PlayerDeathThink( void );
virtual void SetAnimation( PLAYER_ANIM playerAnim );
virtual bool HandleCommand_JoinTeam( int team );
virtual bool ClientCommand( const CCommand &args );
virtual void CreateViewModel( int viewmodelindex = 0 );
virtual bool BecomeRagdollOnClient( const Vector &force );
virtual void Event_Killed( const CTakeDamageInfo &info );
virtual int OnTakeDamage( const CTakeDamageInfo &inputInfo );
virtual bool WantsLagCompensationOnEntity( const CBasePlayer *pPlayer, const CUserCmd *pCmd, const CBitVec<MAX_EDICTS> *pEntityTransmitBits ) const;
virtual void FireBullets ( const FireBulletsInfo_t &info );
virtual bool Weapon_Switch( CBaseCombatWeapon *pWeapon, int viewmodelindex = 0);
virtual bool BumpWeapon( CBaseCombatWeapon *pWeapon );
virtual void ChangeTeam( int iTeam );
virtual void PickupObject ( CBaseEntity *pObject, bool bLimitMassAndSize );
virtual void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
virtual void Weapon_Drop( CBaseCombatWeapon *pWeapon, const Vector *pvecTarget = NULL, const Vector *pVelocity = NULL );
virtual void UpdateOnRemove( void );
virtual void DeathSound( const CTakeDamageInfo &info );
virtual CBaseEntity* EntSelectSpawnPoint( void );
float GetModelScale();
int FlashlightIsOn( void );
void FlashlightTurnOn( void );
void FlashlightTurnOff( void );
void PrecacheFootStepSounds( void );
bool ValidatePlayerModel( const char *pModel );
QAngle GetAnimEyeAngles( void ) { return m_angEyeAngles.Get(); }
Vector GetAttackSpread( CBaseCombatWeapon *pWeapon, CBaseEntity *pTarget = NULL );
void CheatImpulseCommands( int iImpulse );
void CreateRagdollEntity( void );
void GiveAllItems( void );
void GiveDefaultItems( void );
void NoteWeaponFired( void );
void ResetAnimation( void );
void SetPlayerModel( void );
void SetPlayerTeamModel( void );
Activity TranslateTeamActivity( Activity ActToTranslate );
float GetNextModelChangeTime( void ) { return m_flNextModelChangeTime; }
float GetNextTeamChangeTime( void ) { return m_flNextTeamChangeTime; }
void PickDefaultSpawnTeam( void );
void SetupPlayerSoundsByModel( const char *pModelName );
const char *GetPlayerModelSoundPrefix( void );
int GetPlayerModelType( void ) { return m_iPlayerSoundType; }
void DetonateTripmines( void );
void Reset();
bool IsReady();
void SetReady( bool bReady );
void CheckChatText( char *p, int bufsize );
void State_Transition( HL2MPPlayerState newState );
void State_Enter( HL2MPPlayerState newState );
void State_Leave();
void State_PreThink();
CHL2MPPlayerStateInfo *State_LookupInfo( HL2MPPlayerState state );
void State_Enter_ACTIVE();
void State_PreThink_ACTIVE();
void State_Enter_OBSERVER_MODE();
void State_PreThink_OBSERVER_MODE();
virtual bool StartObserverMode( int mode );
virtual void StopObserverMode( void );
void AddExperience(int exp);
Vector m_vecTotalBulletForce; //Accumulator for bullet force in a single frame
// Tracks our ragdoll entity.
CNetworkHandle( CBaseEntity, m_hRagdoll ); // networked entity handle
virtual bool CanHearAndReadChatFrom( CBasePlayer *pPlayer );
CPolyPlayerLocalData GetPolyLocal()
{
return m_PolyLocal;
}
private:
CNetworkQAngle( m_angEyeAngles );
CPlayerAnimState m_PlayerAnimState;
int m_iLastWeaponFireUsercmd;
int m_iModelType;
CNetworkVar( int, m_iSpawnInterpCounter );
CNetworkVar( int, m_iPlayerSoundType );
float m_flNextModelChangeTime;
float m_flNextTeamChangeTime;
float m_flSlamProtectTime;
HL2MPPlayerState m_iPlayerState;
CHL2MPPlayerStateInfo *m_pCurStateInfo;
bool ShouldRunRateLimitedCommand( const CCommand &args );
// This lets us rate limit the commands the players can execute so they don't overflow things like reliable buffers.
CUtlDict<float,int> m_RateLimitLastCommandTimes;
bool m_bEnterObserver;
bool m_bReady;
CNetworkVarEmbedded(CPolyPlayerLocalData ,m_PolyLocal);
};
inline CHL2MP_Player *ToHL2MPPlayer( CBaseEntity *pEntity )
{
if ( !pEntity || !pEntity->IsPlayer() )
return NULL;
return dynamic_cast<CHL2MP_Player*>( pEntity );
}
#endif //HL2MP_PLAYER_H

View File

@@ -258,9 +258,9 @@ private:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class CDynamicProp : public CBreakableProp, public IPositionWatcher class CDynamicProp : public CBreakableProp, public IPositionWatcher
{ {
DECLARE_CLASS( CDynamicProp, CBreakableProp );
public: public:
DECLARE_CLASS( CDynamicProp, CBreakableProp );
DECLARE_SERVERCLASS(); DECLARE_SERVERCLASS();
DECLARE_DATADESC(); DECLARE_DATADESC();
@@ -330,10 +330,10 @@ protected:
DECLARE_AUTO_LIST( IPhysicsPropAutoList ); DECLARE_AUTO_LIST( IPhysicsPropAutoList );
class CPhysicsProp : public CBreakableProp, public IPhysicsPropAutoList class CPhysicsProp : public CBreakableProp, public IPhysicsPropAutoList
{ {
DECLARE_CLASS( CPhysicsProp, CBreakableProp );
DECLARE_SERVERCLASS();
public: public:
DECLARE_CLASS( CPhysicsProp, CBreakableProp );
DECLARE_SERVERCLASS();
~CPhysicsProp(); ~CPhysicsProp();
CPhysicsProp( void ) CPhysicsProp( void )
{ {

View File

@@ -24,6 +24,7 @@ $Project "Server (HL2MP)"
{ {
$Folder "Source Files" $Folder "Source Files"
{ {
$File "polymorph/pickup_exp_item.cpp"
$File "ai_relationship.cpp" $File "ai_relationship.cpp"
$File "basegrenade_concussion.cpp" $File "basegrenade_concussion.cpp"
$File "basegrenade_contact.cpp" $File "basegrenade_contact.cpp"

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<CodeLite_Project Name="server (hl2mp)" InternalType=""> <CodeLite_Project Name="server (polymorph)" InternalType="">
<Description/> <Description/>
<Dependencies/> <Dependencies/>
<Settings Type="Dynamic Library"> <Settings Type="Dynamic Library">
@@ -14,17 +14,17 @@
</GlobalSettings> </GlobalSettings>
<Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<CustomBuild Enabled="yes"> <CustomBuild Enabled="yes">
<RebuildCommand>make CFG=debug -f server_linux32_hl2mp.mak clean all</RebuildCommand> <RebuildCommand>make CFG=debug -f server_linux32_polymorph.mak clean all</RebuildCommand>
<CleanCommand>make CFG=debug -f server_linux32_hl2mp.mak clean</CleanCommand> <CleanCommand>make CFG=debug -f server_linux32_polymorph.mak clean</CleanCommand>
<BuildCommand>make CFG=debug -f server_linux32_hl2mp.mak -j `getconf _NPROCESSORS_ONLN`</BuildCommand> <BuildCommand>make CFG=debug -f server_linux32_polymorph.mak -j `getconf _NPROCESSORS_ONLN`</BuildCommand>
<WorkingDirectory>$(ProjectPath)</WorkingDirectory> <WorkingDirectory>$(ProjectPath)</WorkingDirectory>
</CustomBuild> </CustomBuild>
</Configuration> </Configuration>
<Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<CustomBuild Enabled="yes"> <CustomBuild Enabled="yes">
<RebuildCommand>make -f server_linux32_hl2mp.mak clean all</RebuildCommand> <RebuildCommand>make -f server_linux32_polymorph.mak clean all</RebuildCommand>
<CleanCommand>make -f server_linux32_hl2mp.mak clean</CleanCommand> <CleanCommand>make -f server_linux32_polymorph.mak clean</CleanCommand>
<BuildCommand>make -f server_linux32_hl2mp.mak -j `getconf _NPROCESSORS_ONLN`</BuildCommand> <BuildCommand>make -f server_linux32_polymorph.mak -j `getconf _NPROCESSORS_ONLN`</BuildCommand>
<WorkingDirectory>$(ProjectPath)</WorkingDirectory> <WorkingDirectory>$(ProjectPath)</WorkingDirectory>
</CustomBuild> </CustomBuild>
</Configuration> </Configuration>
@@ -74,11 +74,8 @@
<File Name="../../game/shared/hl2/basehlcombatweapon_shared.cpp"/> <File Name="../../game/shared/hl2/basehlcombatweapon_shared.cpp"/>
<File Name="../../game/shared/hl2/env_headcrabcanister_shared.cpp"/> <File Name="../../game/shared/hl2/env_headcrabcanister_shared.cpp"/>
<File Name="../../game/shared/hl2/hl2_gamerules.cpp"/> <File Name="../../game/shared/hl2/hl2_gamerules.cpp"/>
<File Name="../../game/shared/hl2/hl2_usermessages.cpp"/>
<File Name="../../game/shared/hl2/hl_gamemovement.cpp"/> <File Name="../../game/shared/hl2/hl_gamemovement.cpp"/>
<File Name="../../game/shared/hl2/survival_gamerules.cpp"/> <File Name="../../game/shared/hl2/survival_gamerules.cpp"/>
<File Name="../../game/shared/hl2mp/hl2mp_gamerules.cpp"/>
<File Name="../../game/shared/hl2mp/hl2mp_player_shared.cpp"/>
<File Name="../../game/shared/hl2mp/hl2mp_weapon_parse.cpp"/> <File Name="../../game/shared/hl2mp/hl2mp_weapon_parse.cpp"/>
<File Name="../../game/shared/hl2mp/weapon_357.cpp"/> <File Name="../../game/shared/hl2mp/weapon_357.cpp"/>
<File Name="../../game/shared/hl2mp/weapon_ar2.cpp"/> <File Name="../../game/shared/hl2mp/weapon_ar2.cpp"/>
@@ -111,6 +108,10 @@
<File Name="../../game/shared/physics_shared.cpp"/> <File Name="../../game/shared/physics_shared.cpp"/>
<File Name="../../game/shared/point_bonusmaps_accessor.cpp"/> <File Name="../../game/shared/point_bonusmaps_accessor.cpp"/>
<File Name="../../game/shared/point_posecontroller.cpp"/> <File Name="../../game/shared/point_posecontroller.cpp"/>
<File Name="../../game/shared/polymorph/poly_gamerules.cpp"/>
<File Name="../../game/shared/polymorph/poly_playerlocaldata.cpp"/>
<File Name="../../game/shared/polymorph/poly_player_shared.cpp"/>
<File Name="../../game/shared/polymorph/poly_usermessages.cpp"/>
<File Name="../../game/shared/precache_register.cpp"/> <File Name="../../game/shared/precache_register.cpp"/>
<File Name="../../game/shared/predictableid.cpp"/> <File Name="../../game/shared/predictableid.cpp"/>
<File Name="../../game/shared/predicted_viewmodel.cpp"/> <File Name="../../game/shared/predicted_viewmodel.cpp"/>
@@ -424,10 +425,8 @@
<File Name="hl2mp/grenade_satchel.cpp"/> <File Name="hl2mp/grenade_satchel.cpp"/>
<File Name="hl2mp/grenade_tripmine.cpp"/> <File Name="hl2mp/grenade_tripmine.cpp"/>
<File Name="hl2mp/hl2mp_bot_temp.cpp"/> <File Name="hl2mp/hl2mp_bot_temp.cpp"/>
<File Name="hl2mp/hl2mp_client.cpp"/>
<File Name="hl2mp/hl2mp_cvars.cpp"/> <File Name="hl2mp/hl2mp_cvars.cpp"/>
<File Name="hl2mp/hl2mp_gameinterface.cpp"/> <File Name="hl2mp/hl2mp_gameinterface.cpp"/>
<File Name="hl2mp/hl2mp_player.cpp"/>
<File Name="hl2mp/te_hl2mp_shotgun_shot.cpp"/> <File Name="hl2mp/te_hl2mp_shotgun_shot.cpp"/>
<File Name="hltvdirector.cpp"/> <File Name="hltvdirector.cpp"/>
<File Name="h_ai.cpp"/> <File Name="h_ai.cpp"/>
@@ -504,6 +503,9 @@
<File Name="point_playermoveconstraint.cpp"/> <File Name="point_playermoveconstraint.cpp"/>
<File Name="point_spotlight.cpp"/> <File Name="point_spotlight.cpp"/>
<File Name="point_template.cpp"/> <File Name="point_template.cpp"/>
<File Name="polymorph/pickup_exp_item.cpp"/>
<File Name="polymorph/poly_client.cpp"/>
<File Name="polymorph/poly_player.cpp"/>
<File Name="props.cpp"/> <File Name="props.cpp"/>
<File Name="RagdollBoogie.cpp"/> <File Name="RagdollBoogie.cpp"/>
<File Name="ragdoll_manager.cpp"/> <File Name="ragdoll_manager.cpp"/>
@@ -673,8 +675,6 @@
<File Name="../../game/shared/hl2/hl2_vehicle_radar.h"/> <File Name="../../game/shared/hl2/hl2_vehicle_radar.h"/>
<File Name="../../game/shared/hl2/hl_gamemovement.h"/> <File Name="../../game/shared/hl2/hl_gamemovement.h"/>
<File Name="../../game/shared/hl2/hl_movedata.h"/> <File Name="../../game/shared/hl2/hl_movedata.h"/>
<File Name="../../game/shared/hl2mp/hl2mp_gamerules.h"/>
<File Name="../../game/shared/hl2mp/hl2mp_player_shared.h"/>
<File Name="../../game/shared/hl2mp/hl2mp_weapon_parse.h"/> <File Name="../../game/shared/hl2mp/hl2mp_weapon_parse.h"/>
<File Name="../../game/shared/hl2mp/weapon_ar2.h"/> <File Name="../../game/shared/hl2mp/weapon_ar2.h"/>
<File Name="../../game/shared/hl2mp/weapon_hl2mpbase.h"/> <File Name="../../game/shared/hl2mp/weapon_hl2mpbase.h"/>
@@ -707,6 +707,10 @@
<File Name="../../game/shared/playernet_vars.h"/> <File Name="../../game/shared/playernet_vars.h"/>
<File Name="../../game/shared/point_bonusmaps_accessor.h"/> <File Name="../../game/shared/point_bonusmaps_accessor.h"/>
<File Name="../../game/shared/point_posecontroller.h"/> <File Name="../../game/shared/point_posecontroller.h"/>
<File Name="../../game/shared/polymorph/poly_gamerules.h"/>
<File Name="../../game/shared/polymorph/poly_playerlocaldata.h"/>
<File Name="../../game/shared/polymorph/poly_player_shared.h"/>
<File Name="../../game/shared/polymorph/poly_shareddefs.h"/>
<File Name="../../game/shared/positionwatcher.h"/> <File Name="../../game/shared/positionwatcher.h"/>
<File Name="../../game/shared/precache_register.h"/> <File Name="../../game/shared/precache_register.h"/>
<File Name="../../game/shared/precipitation_shared.h"/> <File Name="../../game/shared/precipitation_shared.h"/>
@@ -1084,7 +1088,6 @@
<File Name="hl2mp/grenade_tripmine.h"/> <File Name="hl2mp/grenade_tripmine.h"/>
<File Name="hl2mp/hl2mp_bot_temp.h"/> <File Name="hl2mp/hl2mp_bot_temp.h"/>
<File Name="hl2mp/hl2mp_gameinterface.h"/> <File Name="hl2mp/hl2mp_gameinterface.h"/>
<File Name="hl2mp/hl2mp_player.h"/>
<File Name="hl2mp/te_hl2mp_shotgun_shot.h"/> <File Name="hl2mp/te_hl2mp_shotgun_shot.h"/>
<File Name="hltvdirector.h"/> <File Name="hltvdirector.h"/>
<File Name="h_cycler.h"/> <File Name="h_cycler.h"/>
@@ -1139,6 +1142,7 @@
<File Name="player_resource.h"/> <File Name="player_resource.h"/>
<File Name="point_camera.h"/> <File Name="point_camera.h"/>
<File Name="point_template.h"/> <File Name="point_template.h"/>
<File Name="polymorph/poly_player.h"/>
<File Name="props.h"/> <File Name="props.h"/>
<File Name="pushentity.h"/> <File Name="pushentity.h"/>
<File Name="RagdollBoogie.h"/> <File Name="RagdollBoogie.h"/>
@@ -1205,7 +1209,7 @@
<File Name="../../vpc_scripts/source_video_base.vpc"/> <File Name="../../vpc_scripts/source_video_base.vpc"/>
<File Name="../../vpc_scripts/version.vpc"/> <File Name="../../vpc_scripts/version.vpc"/>
<File Name="../../vpc_scripts/version.vpc"/> <File Name="../../vpc_scripts/version.vpc"/>
<File Name="server_hl2mp.vpc"/> <File Name="server_polymorph.vpc"/>
<File Name="server_hl2mp.vpc"/> <File Name="server_polymorph.vpc"/>
</VirtualDirectory> </VirtualDirectory>
</CodeLite_Project> </CodeLite_Project>

View File

@@ -0,0 +1,306 @@
//-----------------------------------------------------------------------------
// SERVER_HL2MP.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
//$Macro GAMENAME "hl2mp" [!$SOURCESDK]
$Macro GAMENAME "mod_hl2mp"
$Include "$SRCDIR\game\server\server_base.vpc"
$Include "$SRCDIR\game\server\nav_mesh.vpc" [$SOURCESDK]
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;$SRCDIR\game\shared\hl2,.\hl2,.\hl2mp,$SRCDIR\game\shared\hl2mp"
$AdditionalIncludeDirectories "$BASE;$SRCDIR\game\shared\polymorph,.\polymorph"
$PreprocessorDefinitions "$BASE;HL2MP;HL2_DLL;POLY"
}
}
$Project "Server (polymorph)"
{
$Folder "Source Files"
{
$Folder "polymorph"
{
$File "polymorph/poly_client.cpp"
$File "polymorph/pickup_exp_item.cpp"
$File "polymorph/poly_player.h"
$File "polymorph/poly_player.cpp"
$File "$SRCDIR\game\shared\polymorph/poly_playerlocaldata.cpp"
$File "$SRCDIR\game\shared\polymorph/poly_playerlocaldata.h"
$File "$SRCDIR\game\shared\polymorph\poly_gamerules.cpp"
$File "$SRCDIR\game\shared\polymorph\poly_gamerules.h"
$File "$SRCDIR\game\shared\polymorph\poly_player_shared.cpp"
$File "$SRCDIR\game\shared\polymorph\poly_player_shared.h"
$File "$SRCDIR\game\shared\polymorph\poly_shareddefs.h"
$File "$SRCDIR\game\shared\polymorph\poly_usermessages.cpp"
}
$File "ai_relationship.cpp"
$File "basegrenade_concussion.cpp"
$File "basegrenade_contact.cpp"
$File "basegrenade_timed.cpp"
$File "EntityFlame.h"
$File "hl2\Func_Monitor.cpp"
$File "grenadethrown.cpp"
$File "grenadethrown.h"
$File "h_cycler.cpp"
$File "h_cycler.h"
$File "monstermaker.cpp"
$File "monstermaker.h"
$File "physics_bone_follower.h"
$File "$SRCDIR\game\shared\predicted_viewmodel.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.h"
$File "$SRCDIR\game\shared\ragdoll_shared.h"
$File "$SRCDIR\game\shared\solidsetdefaults.h"
$File "$SRCDIR\game\shared\hl2\survival_gamerules.cpp"
$File "team_objectiveresource.cpp"
$File "team_objectiveresource.h"
$File "team_spawnpoint.cpp"
$File "team_spawnpoint.h"
$File "team_control_point.cpp"
$File "team_control_point.h"
$File "team_control_point_master.cpp"
$File "team_control_point_master.h"
$File "team_control_point_round.cpp"
$File "team_control_point_round.h"
$File "team_train_watcher.cpp"
$File "team_train_watcher.h"
$File "$SRCDIR\game\shared\teamplayroundbased_gamerules.cpp"
$File "$SRCDIR\game\shared\touchlink.h"
$File "trigger_area_capture.cpp"
$File "trigger_area_capture.h"
$File "$SRCDIR\game\shared\teamplay_round_timer.cpp"
$File "$SRCDIR\game\shared\teamplay_round_timer.h"
$Folder "HL2 DLL"
{
$File "hl2\hl2_playerlocaldata.h"
$File "hl2\hl2_playerlocaldata.cpp"
$File "hl2\ai_allymanager.cpp"
$File "hl2\ai_behavior_actbusy.cpp"
$File "hl2\ai_behavior_actbusy.h"
$File "hl2\ai_behavior_functank.cpp"
$File "hl2\ai_behavior_functank.h"
$File "hl2\ai_behavior_holster.cpp"
$File "hl2\ai_behavior_holster.h"
$File "hl2\ai_behavior_police.cpp"
$File "hl2\ai_behavior_police.h"
$File "hl2\ai_goal_police.cpp"
$File "hl2\ai_goal_police.h"
$File "hl2\ai_interactions.h"
$File "hl2\ai_spotlight.cpp"
$File "hl2\ai_spotlight.h"
$File "hl2\antlion_dust.cpp"
$File "hl2\antlion_dust.h"
$File "hl2\antlion_maker.cpp"
$File "hl2\antlion_maker.h"
$File "hl2\ar2_explosion.cpp"
$File "hl2\ar2_explosion.h"
$File "basebludgeonweapon.cpp"
$File "basebludgeonweapon.h"
$File "hl2\basehlcombatweapon.cpp"
$File "hl2\basehlcombatweapon.h"
$File "$SRCDIR\game\shared\hl2\basehlcombatweapon_shared.cpp"
$File "$SRCDIR\game\shared\hl2\basehlcombatweapon_shared.h"
$File "hl2\cbasehelicopter.cpp"
$File "hl2\cbasehelicopter.h"
$File "hl2\cbasespriteprojectile.cpp"
$File "hl2\cbasespriteprojectile.h"
$File "hl2\citadel_effects.cpp"
$File "$SRCDIR\game\shared\hl2\citadel_effects_shared.h"
$File "hl2\combine_mine.cpp"
$File "hl2\combine_mine.h"
$File "hl2\energy_wave.h"
$File "hl2\env_alyxemp.cpp"
$File "$SRCDIR\game\shared\hl2\env_alyxemp_shared.h"
$File "hl2\env_headcrabcanister.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.h"
$File "hl2\env_speaker.cpp"
$File "hl2\env_starfield.cpp"
$File "hl2\func_recharge.cpp"
$File "hl2\func_tank.cpp"
$File "hl2\func_tank.h"
$File "hl2\grenade_ar2.cpp"
$File "hl2\grenade_ar2.h"
$File "hl2\grenade_bugbait.cpp"
$File "hl2\grenade_bugbait.h"
$File "hl2\grenade_frag.cpp"
$File "hl2\grenade_frag.h"
$File "hl2\hl2_ai_network.cpp"
$File "hl2\hl2_eventlog.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.h"
$File "hl2\hl2_player.cpp"
$File "hl2\hl2_player.h"
$File "$SRCDIR\game\shared\hl2\hl2_player_shared.h"
$File "$SRCDIR\game\shared\hl2\hl2_shareddefs.h"
$File "hl2\hl2_triggers.cpp"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.cpp"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.h"
$File "$SRCDIR\game\shared\hl2\hl_movedata.h"
$File "hl2\hl_playermove.cpp"
$File "hl2\info_teleporter_countdown.cpp"
$File "hl2\item_ammo.cpp"
$File "hl2\item_battery.cpp"
$File "hl2\item_dynamic_resupply.cpp"
$File "hl2\item_dynamic_resupply.h"
$File "hl2\item_healthkit.cpp"
$File "hl2\item_itemcrate.cpp"
$File "hl2\item_suit.cpp"
$File "hl2\look_door.cpp"
$File "hl2\monster_dummy.cpp"
$File "hl2\npc_alyx.cpp"
$File "hl2\npc_alyx.h"
$File "hl2\npc_antlion.cpp"
$File "hl2\npc_antlion.h"
$File "hl2\npc_antlionguard.cpp"
$File "hl2\npc_apcdriver.cpp"
$File "hl2\npc_attackchopper.cpp"
$File "hl2\npc_attackchopper.h"
$File "hl2\npc_barnacle.cpp"
$File "hl2\npc_barnacle.h"
$File "hl2\npc_barney.cpp"
$File "hl2\npc_basescanner.cpp"
$File "hl2\npc_basescanner.h"
$File "hl2\npc_BaseZombie.cpp"
$File "hl2\npc_BaseZombie.h"
$File "hl2\npc_breen.cpp"
$File "hl2\npc_bullseye.cpp"
$File "hl2\npc_bullseye.h"
$File "hl2\npc_citizen17.cpp"
$File "hl2\npc_citizen17.h"
$File "hl2\npc_combine.cpp"
$File "hl2\npc_combine.h"
$File "hl2\npc_combinecamera.cpp"
$File "hl2\npc_combinedropship.cpp"
$File "hl2\npc_combinegunship.cpp"
$File "hl2\npc_combines.cpp"
$File "hl2\npc_combines.h"
$File "hl2\npc_cranedriver.cpp"
$File "hl2\npc_crow.cpp"
$File "hl2\npc_crow.h"
$File "hl2\npc_dog.cpp"
$File "hl2\npc_eli.cpp"
$File "hl2\npc_enemyfinder.cpp"
$File "hl2\npc_fisherman.cpp"
$File "hl2\npc_gman.cpp"
$File "hl2\npc_headcrab.cpp"
$File "hl2\npc_headcrab.h"
$File "hl2\npc_ichthyosaur.cpp"
$File "hl2\npc_kleiner.cpp"
$File "hl2\npc_launcher.cpp"
$File "hl2\npc_manhack.cpp"
$File "hl2\npc_manhack.h"
$File "hl2\npc_metropolice.cpp"
$File "hl2\npc_metropolice.h"
$File "hl2\npc_monk.cpp"
$File "hl2\npc_mossman.cpp"
$File "hl2\npc_playercompanion.cpp"
$File "hl2\npc_playercompanion.h"
$File "hl2\npc_PoisonZombie.cpp"
$File "hl2\npc_rollermine.cpp"
$File "hl2\npc_rollermine.h"
$File "hl2\npc_scanner.cpp"
$File "hl2\npc_stalker.cpp"
$File "hl2\npc_stalker.h"
$File "hl2\npc_strider.cpp"
$File "hl2\npc_strider.h"
$File "npc_talker.cpp"
$File "npc_talker.h"
$File "hl2\npc_turret_ceiling.cpp"
$File "hl2\npc_turret_floor.cpp"
$File "hl2\npc_turret_ground.cpp"
$File "hl2\npc_vortigaunt_episodic.cpp"
$File "hl2\npc_vortigaunt_episodic.h"
$File "hl2\npc_zombie.cpp"
$File "hl2\point_apc_controller.cpp"
$File "hl2\prop_combine_ball.cpp"
$File "hl2\prop_combine_ball.h"
$File "hl2\prop_thumper.cpp"
$File "hl2\proto_sniper.cpp"
$File "hl2\rotorwash.cpp"
$File "hl2\rotorwash.h"
$File "hl2\script_intro.cpp"
$File "hl2\script_intro.h"
$File "$SRCDIR\game\shared\script_intro_shared.cpp"
$File "hl2\vehicle_airboat.cpp"
$File "hl2\vehicle_apc.h"
$File "hl2\vehicle_crane.cpp"
$File "hl2\vehicle_crane.h"
$File "hl2\vehicle_prisoner_pod.cpp"
$File "hl2\vehicle_viewcontroller.cpp"
$File "hl2\weapon_alyxgun.h"
$File "hl2\weapon_annabelle.cpp"
$File "hl2\weapon_bugbait.cpp"
$File "hl2\weapon_crowbar.h"
$File "weapon_cubemap.cpp"
$Folder "unused"
{
$File "hl2\grenade_beam.cpp"
$File "hl2\grenade_beam.h"
$File "hl2\grenade_homer.cpp"
$File "hl2\grenade_homer.h"
$File "hl2\grenade_pathfollower.cpp"
$File "hl2\grenade_pathfollower.h"
$File "hl2\npc_missiledefense.cpp"
$File "hl2\vehicle_apc.cpp"
$File "hl2\weapon_cguard.cpp"
$File "hl2\weapon_flaregun.cpp"
$File "hl2\weapon_flaregun.h"
}
}
$Folder "HL2MP"
{
$File "hl2mp\hl2mp_bot_temp.cpp"
$File "hl2mp\hl2mp_bot_temp.h"
//$File "hl2mp\hl2mp_client.cpp"
$File "hl2mp\hl2mp_cvars.cpp"
$File "hl2mp\hl2mp_gameinterface.cpp"
$File "hl2mp\hl2mp_gameinterface.h"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_weapon_parse.cpp"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_weapon_parse.h"
$Folder "Weapons"
{
$File "hl2mp\grenade_satchel.cpp"
$File "hl2mp\grenade_satchel.h"
$File "hl2mp\grenade_tripmine.cpp"
$File "hl2mp\grenade_tripmine.h"
$File "hl2mp\te_hl2mp_shotgun_shot.cpp"
$File "hl2mp\te_hl2mp_shotgun_shot.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_357.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_ar2.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_ar2.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_crossbow.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_crowbar.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_frag.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase_machinegun.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase_machinegun.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasebasebludgeon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasehlmpcombatweapon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasehlmpcombatweapon.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_physcannon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_physcannon.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_pistol.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_rpg.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_rpg.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_shotgun.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_slam.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_slam.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_smg1.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.cpp"
}
}
}
}

View File

@@ -18,6 +18,7 @@ static Vector CAM_HULL_MAX( CAM_HULL_OFFSET, CAM_HULL_OFFSET, CAM_HULL_OFFSET);
#include "input.h" #include "input.h"
#include "c_poly_player.h"
extern const ConVar *sv_cheats; extern const ConVar *sv_cheats;
@@ -43,7 +44,11 @@ void ThirdPersonChange( IConVar *pConVar, const char *pOldValue, float flOldValu
ToggleThirdPerson( var.GetBool() ); ToggleThirdPerson( var.GetBool() );
} }
ConVar cl_thirdperson( "cl_thirdperson", "0", FCVAR_NOT_CONNECTED | FCVAR_USERINFO | FCVAR_ARCHIVE | FCVAR_DEVELOPMENTONLY, "Enables/Disables third person", ThirdPersonChange ); ConVar cl_thirdperson( "cl_thirdperson", "0", FCVAR_NOT_CONNECTED | FCVAR_USERINFO | FCVAR_ARCHIVE /*| FCVAR_DEVELOPMENTONLY*/, "Enables/Disables third person", ThirdPersonChange );
#else
#include "poly_player.h"
#endif #endif
@@ -147,6 +152,16 @@ void CThirdPersonManager::PositionCamera( CBasePlayer *pPlayer, const QAngle& an
{ {
if ( pPlayer ) if ( pPlayer )
{ {
//HACKHACK
C_BasePlayer *localPlayer = C_BasePlayer::GetLocalPlayer();
C_HL2MP_Player* pPolyPlayer = (C_HL2MP_Player*)localPlayer;
float scale = 1;
if(pPolyPlayer)
{
scale = g_iaTableExpPerLevel[pPolyPlayer->GetPolyLocal().m_iPolyLevel].player_scale;
}
trace_t trace; trace_t trace;
Vector camForward, camRight, camUp; Vector camForward, camRight, camUp;
@@ -163,7 +178,7 @@ void CThirdPersonManager::PositionCamera( CBasePlayer *pPlayer, const QAngle& an
// use our previously #defined hull to collision trace // use our previously #defined hull to collision trace
CTraceFilterSimple traceFilter( pPlayer, COLLISION_GROUP_NONE ); CTraceFilterSimple traceFilter( pPlayer, COLLISION_GROUP_NONE );
UTIL_TraceHull( endPos, vecCamOffset, CAM_HULL_MIN, CAM_HULL_MAX, MASK_SOLID & ~CONTENTS_MONSTER, &traceFilter, &trace ); UTIL_TraceHull( endPos, vecCamOffset, scale * CAM_HULL_MIN, scale * CAM_HULL_MAX, MASK_SOLID & ~CONTENTS_MONSTER, &traceFilter, &trace );
if ( trace.fraction != m_flTargetFraction ) if ( trace.fraction != m_flTargetFraction )
{ {

View File

@@ -1958,7 +1958,8 @@ void CGameMovement::WalkMove( void )
// Set pmove velocity // Set pmove velocity
mv->m_vecVelocity[2] = 0; mv->m_vecVelocity[2] = 0;
Accelerate ( wishdir, wishspeed, sv_accelerate.GetFloat() ); //Accelerate ( wishdir, wishspeed, sv_accelerate.GetFloat() );
Accelerate ( wishdir, wishspeed, player->GetAcceleration() );
mv->m_vecVelocity[2] = 0; mv->m_vecVelocity[2] = 0;
// Add in any base velocity to the current velocity. // Add in any base velocity to the current velocity.
@@ -4798,7 +4799,8 @@ void CGameMovement::FullTossMove( void )
} }
// Set pmove velocity // Set pmove velocity
Accelerate ( wishdir, wishspeed, sv_accelerate.GetFloat() ); //Accelerate ( wishdir, wishspeed, sv_accelerate.GetFloat() );
Accelerate ( wishdir, wishspeed, player->GetAcceleration() );
} }
if ( mv->m_vecVelocity[2] > 0 ) if ( mv->m_vecVelocity[2] > 0 )

View File

@@ -179,6 +179,11 @@ void CCrossbowBolt::Spawn( void )
CreateSprites(); CreateSprites();
#ifdef CLIENT_DLL
// we should care about it for bolts
m_bForceNoInterpolation = true;
#endif
// Make us glow until we've hit the wall // Make us glow until we've hit the wall
m_nSkin = BOLT_SKIN_GLOW; m_nSkin = BOLT_SKIN_GLOW;
} }

View File

@@ -525,7 +525,6 @@ void CGrabController::AttachEntity( CBasePlayer *pPlayer, CBaseEntity *pEntity,
m_controller->AttachObject( pPhys, true ); m_controller->AttachObject( pPhys, true );
// Don't do this, it's causing trouble with constraint solvers. // Don't do this, it's causing trouble with constraint solvers.
//m_controller->SetPriority( IPhysicsMotionController::HIGH_PRIORITY ); //m_controller->SetPriority( IPhysicsMotionController::HIGH_PRIORITY );
pPhys->Wake(); pPhys->Wake();
PhysSetGameFlags( pPhys, FVPHYSICS_PLAYER_HELD ); PhysSetGameFlags( pPhys, FVPHYSICS_PLAYER_HELD );
SetTargetPosition( position, angles ); SetTargetPosition( position, angles );
@@ -551,10 +550,10 @@ void CGrabController::AttachEntity( CBasePlayer *pPlayer, CBaseEntity *pEntity,
pList[i]->SetDamping( NULL, &damping ); pList[i]->SetDamping( NULL, &damping );
} }
// Give extra mass to the phys object we're actually picking up // Give extra mass to the phys object we're actually picking up
pPhys->SetMass( REDUCED_CARRY_MASS ); pPhys->SetMass( REDUCED_CARRY_MASS );
pPhys->EnableDrag( false ); pPhys->EnableDrag( false );
m_errorTime = -1.0f; // 1 seconds until error starts accumulating m_errorTime = -1.0f; // 1 seconds until error starts accumulating
m_error = 0; m_error = 0;
m_contactAmount = 0; m_contactAmount = 0;
@@ -578,8 +577,10 @@ void CGrabController::AttachEntity( CBasePlayer *pPlayer, CBaseEntity *pEntity,
{ {
m_bHasPreferredCarryAngles = false; m_bHasPreferredCarryAngles = false;
} }
#else
pEntity->m_bForceNoInterpolate = true;
#else
//pEntity->SetPredictable(false);
m_bHasPreferredCarryAngles = false; m_bHasPreferredCarryAngles = false;
#endif #endif
@@ -635,6 +636,12 @@ void CGrabController::DetachEntity( bool bClearVelocity )
} }
} }
#ifndef CLIENT_DLL
//pEntity->SetPredictable(true);
if(pEntity)
pEntity->m_bForceNoInterpolate = false;
#endif
m_attachedEntity = NULL; m_attachedEntity = NULL;
if ( physenv ) if ( physenv )
{ {
@@ -675,10 +682,6 @@ IMotionEvent::simresult_e CGrabController::Simulate( IPhysicsMotionController *p
shadowParams.maxAngular = m_shadow.maxAngular * m_contactAmount * m_contactAmount * m_contactAmount; shadowParams.maxAngular = m_shadow.maxAngular * m_contactAmount * m_contactAmount * m_contactAmount;
#ifndef CLIENT_DLL #ifndef CLIENT_DLL
m_timeToArrive = pObject->ComputeShadowControl( shadowParams, m_timeToArrive, deltaTime ); m_timeToArrive = pObject->ComputeShadowControl( shadowParams, m_timeToArrive, deltaTime );
#else
m_timeToArrive = pObject->ComputeShadowControl( shadowParams, (TICK_INTERVAL*2), deltaTime );
#endif
// Slide along the current contact points to fix bouncing problems // Slide along the current contact points to fix bouncing problems
Vector velocity; Vector velocity;
AngularImpulse angVel; AngularImpulse angVel;
@@ -689,6 +692,9 @@ IMotionEvent::simresult_e CGrabController::Simulate( IPhysicsMotionController *p
linear.Init(); linear.Init();
angular.Init(); angular.Init();
m_errorTime += deltaTime; m_errorTime += deltaTime;
#else
// m_timeToArrive = pObject->ComputeShadowControl( shadowParams, (TICK_INTERVAL*2), deltaTime );
#endif
return SIM_LOCAL_ACCELERATION; return SIM_LOCAL_ACCELERATION;
} }
@@ -1109,7 +1115,8 @@ public:
CNetworkHandle( CBaseEntity, m_hAttachedObject ); CNetworkHandle( CBaseEntity, m_hAttachedObject );
EHANDLE m_hOldAttachedObject; //EHANDLE m_hOldAttachedObject;
CNetworkHandle( CBaseEntity,m_hOldAttachedObject);
protected: protected:
enum FindObjectResult_t enum FindObjectResult_t
@@ -1261,6 +1268,7 @@ BEGIN_NETWORK_TABLE( CWeaponPhysCannon, DT_WeaponPhysCannon )
#ifdef CLIENT_DLL #ifdef CLIENT_DLL
RecvPropBool( RECVINFO( m_bActive ) ), RecvPropBool( RECVINFO( m_bActive ) ),
RecvPropEHandle( RECVINFO( m_hAttachedObject ) ), RecvPropEHandle( RECVINFO( m_hAttachedObject ) ),
RecvPropEHandle( RECVINFO( m_hOldAttachedObject ) ),
RecvPropVector( RECVINFO( m_attachedPositionObjectSpace ) ), RecvPropVector( RECVINFO( m_attachedPositionObjectSpace ) ),
RecvPropFloat( RECVINFO( m_attachedAnglesPlayerSpace[0] ) ), RecvPropFloat( RECVINFO( m_attachedAnglesPlayerSpace[0] ) ),
RecvPropFloat( RECVINFO( m_attachedAnglesPlayerSpace[1] ) ), RecvPropFloat( RECVINFO( m_attachedAnglesPlayerSpace[1] ) ),
@@ -1270,6 +1278,7 @@ BEGIN_NETWORK_TABLE( CWeaponPhysCannon, DT_WeaponPhysCannon )
#else #else
SendPropBool( SENDINFO( m_bActive ) ), SendPropBool( SENDINFO( m_bActive ) ),
SendPropEHandle( SENDINFO( m_hAttachedObject ) ), SendPropEHandle( SENDINFO( m_hAttachedObject ) ),
SendPropEHandle( SENDINFO(m_hOldAttachedObject) ),
SendPropVector(SENDINFO( m_attachedPositionObjectSpace ), -1, SPROP_COORD), SendPropVector(SENDINFO( m_attachedPositionObjectSpace ), -1, SPROP_COORD),
SendPropAngle( SENDINFO_VECTORELEM(m_attachedAnglesPlayerSpace, 0 ), 11 ), SendPropAngle( SENDINFO_VECTORELEM(m_attachedAnglesPlayerSpace, 0 ), 11 ),
SendPropAngle( SENDINFO_VECTORELEM(m_attachedAnglesPlayerSpace, 1 ), 11 ), SendPropAngle( SENDINFO_VECTORELEM(m_attachedAnglesPlayerSpace, 1 ), 11 ),
@@ -1794,7 +1803,6 @@ float CWeaponPhysCannon::TraceLength()
return physcannon_tracelength.GetFloat(); return physcannon_tracelength.GetFloat();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: // Purpose:
// //
@@ -2027,6 +2035,7 @@ bool CWeaponPhysCannon::AttachObject( CBaseEntity *pObject, const Vector &vPosit
// NOTE :This must happen after OnPhysGunPickup because that can change the mass // NOTE :This must happen after OnPhysGunPickup because that can change the mass
m_grabController.AttachEntity( pOwner, pObject, pPhysics, false, vPosition, false ); m_grabController.AttachEntity( pOwner, pObject, pPhysics, false, vPosition, false );
m_hAttachedObject = pObject; m_hAttachedObject = pObject;
m_hOldAttachedObject = NULL;
m_attachedPositionObjectSpace = m_grabController.m_attachedPositionObjectSpace; m_attachedPositionObjectSpace = m_grabController.m_attachedPositionObjectSpace;
m_attachedAnglesPlayerSpace = m_grabController.m_attachedAnglesPlayerSpace; m_attachedAnglesPlayerSpace = m_grabController.m_attachedAnglesPlayerSpace;
@@ -2426,50 +2435,51 @@ void CWeaponPhysCannon::DetachObject( bool playSound, bool wasLaunched )
#ifdef CLIENT_DLL #ifdef CLIENT_DLL
void CWeaponPhysCannon::ManagePredictedObject( void ) //void CWeaponPhysCannon::ManagePredictedObject( void )
{ //{
CBaseEntity *pAttachedObject = m_hAttachedObject.Get(); // CBaseEntity *pAttachedObject = m_hAttachedObject.Get();
//
// if ( m_hAttachedObject )
// {
// // NOTE :This must happen after OnPhysGunPickup because that can change the mass
// if ( pAttachedObject != GetGrabController().GetAttached() )
// {
// IPhysicsObject *pPhysics = pAttachedObject->VPhysicsGetObject();
//
// if ( pPhysics == NULL )
// {
// solid_t tmpSolid;
// PhysModelParseSolid( tmpSolid, m_hAttachedObject, pAttachedObject->GetModelIndex() );
//
// pAttachedObject->VPhysicsInitNormal( SOLID_VPHYSICS, 0, false, &tmpSolid );
// }
//
// pPhysics = pAttachedObject->VPhysicsGetObject();
//
// if ( pPhysics )
// {
// m_grabController.SetIgnorePitch( false );
// m_grabController.SetAngleAlignment( 0 );
//
// GetGrabController().AttachEntity( ToBasePlayer( GetOwner() ), pAttachedObject, pPhysics, false, vec3_origin, false );
// GetGrabController().m_attachedPositionObjectSpace = m_attachedPositionObjectSpace;
// GetGrabController().m_attachedAnglesPlayerSpace = m_attachedAnglesPlayerSpace;
// }
// }
// }
// else
// {
// if ( m_hOldAttachedObject && m_hOldAttachedObject->VPhysicsGetObject() )
// {
// GetGrabController().DetachEntity( false );
//
// m_hOldAttachedObject->VPhysicsDestroyObject();
// }
// }
//
// m_hOldAttachedObject = m_hAttachedObject;
//}
if ( m_hAttachedObject )
{
// NOTE :This must happen after OnPhysGunPickup because that can change the mass
if ( pAttachedObject != GetGrabController().GetAttached() )
{
IPhysicsObject *pPhysics = pAttachedObject->VPhysicsGetObject();
if ( pPhysics == NULL )
{
solid_t tmpSolid;
PhysModelParseSolid( tmpSolid, m_hAttachedObject, pAttachedObject->GetModelIndex() );
pAttachedObject->VPhysicsInitNormal( SOLID_VPHYSICS, 0, false, &tmpSolid );
}
pPhysics = pAttachedObject->VPhysicsGetObject();
if ( pPhysics )
{
m_grabController.SetIgnorePitch( false );
m_grabController.SetAngleAlignment( 0 );
GetGrabController().AttachEntity( ToBasePlayer( GetOwner() ), pAttachedObject, pPhysics, false, vec3_origin, false );
GetGrabController().m_attachedPositionObjectSpace = m_attachedPositionObjectSpace;
GetGrabController().m_attachedAnglesPlayerSpace = m_attachedAnglesPlayerSpace;
}
}
}
else
{
if ( m_hOldAttachedObject && m_hOldAttachedObject->VPhysicsGetObject() )
{
GetGrabController().DetachEntity( false );
m_hOldAttachedObject->VPhysicsDestroyObject();
}
}
m_hOldAttachedObject = m_hAttachedObject;
}
#endif #endif
@@ -2524,10 +2534,15 @@ void CWeaponPhysCannon::ItemPreFrame()
BaseClass::ItemPreFrame(); BaseClass::ItemPreFrame();
#ifdef CLIENT_DLL #ifdef CLIENT_DLL
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer(); //C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
if ( localplayer && !localplayer->IsObserver() ) //if ( localplayer && !localplayer->IsObserver() )
ManagePredictedObject(); // ManagePredictedObject();
//if(m_hAttachedObject)
// m_hAttachedObject.Get()->m_bForceNoInterpolate = true;
//else
// if(m_hOldAttachedObject)
// m_hOldAttachedObject.Get()->m_bForceNoInterpolate = false;
#endif #endif
// Update the object if the weapon is switched on. // Update the object if the weapon is switched on.

View File

@@ -147,8 +147,12 @@ class CWeaponRPG;
CMissile::CMissile() CMissile::CMissile()
{ {
m_hRocketTrail = NULL; m_hRocketTrail = NULL;
#ifdef CLIENT_DLL
m_bForceNoInterpolate = true;
#endif
} }
CMissile::~CMissile() CMissile::~CMissile()
{ {
} }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,175 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//=============================================================================//
#ifndef HL2MP_GAMERULES_H
#define HL2MP_GAMERULES_H
#pragma once
#include "gamerules.h"
#include "teamplay_gamerules.h"
#include "gamevars_shared.h"
#ifndef CLIENT_DLL
#include "polymorph/poly_player.h"
#endif
#define VEC_CROUCH_TRACE_MIN HL2MPRules()->GetHL2MPViewVectors()->m_vCrouchTraceMin
#define VEC_CROUCH_TRACE_MAX HL2MPRules()->GetHL2MPViewVectors()->m_vCrouchTraceMax
enum
{
TEAM_COMBINE = 2,
TEAM_REBELS,
};
#ifdef CLIENT_DLL
#define CHL2MPRules C_HL2MPRules
#define CHL2MPGameRulesProxy C_HL2MPGameRulesProxy
#endif
class CHL2MPGameRulesProxy : public CGameRulesProxy
{
public:
DECLARE_CLASS( CHL2MPGameRulesProxy, CGameRulesProxy );
DECLARE_NETWORKCLASS();
};
class HL2MPViewVectors : public CViewVectors
{
public:
HL2MPViewVectors(
Vector vView,
Vector vHullMin,
Vector vHullMax,
Vector vDuckHullMin,
Vector vDuckHullMax,
Vector vDuckView,
Vector vObsHullMin,
Vector vObsHullMax,
Vector vDeadViewHeight,
Vector vCrouchTraceMin,
Vector vCrouchTraceMax ) :
CViewVectors(
vView,
vHullMin,
vHullMax,
vDuckHullMin,
vDuckHullMax,
vDuckView,
vObsHullMin,
vObsHullMax,
vDeadViewHeight )
{
m_vCrouchTraceMin = vCrouchTraceMin;
m_vCrouchTraceMax = vCrouchTraceMax;
}
Vector m_vCrouchTraceMin;
Vector m_vCrouchTraceMax;
};
class CHL2MPRules : public CTeamplayRules
{
public:
DECLARE_CLASS( CHL2MPRules, CTeamplayRules );
#ifdef CLIENT_DLL
DECLARE_CLIENTCLASS_NOBASE(); // This makes datatables able to access our private vars.
#else
DECLARE_SERVERCLASS_NOBASE(); // This makes datatables able to access our private vars.
#endif
CHL2MPRules();
virtual ~CHL2MPRules();
virtual void Precache( void );
virtual bool ShouldCollide( int collisionGroup0, int collisionGroup1 );
virtual bool ClientCommand( CBaseEntity *pEdict, const CCommand &args );
virtual float FlWeaponRespawnTime( CBaseCombatWeapon *pWeapon );
virtual float FlWeaponTryRespawn( CBaseCombatWeapon *pWeapon );
virtual Vector VecWeaponRespawnSpot( CBaseCombatWeapon *pWeapon );
virtual int WeaponShouldRespawn( CBaseCombatWeapon *pWeapon );
virtual void Think( void );
virtual void CreateStandardEntities( void );
virtual void ClientSettingsChanged( CBasePlayer *pPlayer );
virtual int PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget );
virtual void GoToIntermission( void );
virtual void DeathNotice( CBasePlayer *pVictim, const CTakeDamageInfo &info );
virtual const char *GetGameDescription( void );
// derive this function if you mod uses encrypted weapon info files
virtual const unsigned char *GetEncryptionKey( void ) { return (unsigned char *)"x9Ke0BY7"; }
virtual const CViewVectors* GetViewVectors() const;
const HL2MPViewVectors* GetHL2MPViewVectors() const;
virtual bool AllowThirdPersonCamera( void ) { return true; }
void CheckPolymorphStuff();
float GetMapRemainingTime();
void CleanUpMap();
void CheckRestartGame();
void RestartGame();
#ifndef CLIENT_DLL
virtual Vector VecItemRespawnSpot( CItem *pItem );
virtual QAngle VecItemRespawnAngles( CItem *pItem );
virtual float FlItemRespawnTime( CItem *pItem );
virtual bool CanHavePlayerItem( CBasePlayer *pPlayer, CBaseCombatWeapon *pItem );
virtual bool FShouldSwitchWeapon( CBasePlayer *pPlayer, CBaseCombatWeapon *pWeapon );
void AddLevelDesignerPlacedObject( CBaseEntity *pEntity );
void RemoveLevelDesignerPlacedObject( CBaseEntity *pEntity );
void ManageObjectRelocation( void );
void CheckChatForReadySignal( CHL2MP_Player *pPlayer, const char *chatmsg );
const char *GetChatFormat( bool bTeamOnly, CBasePlayer *pPlayer );
#endif
virtual void ClientDisconnected( edict_t *pClient );
bool CheckGameOver( void );
bool IsIntermission( void );
void PlayerKilled( CBasePlayer *pVictim, const CTakeDamageInfo &info );
bool IsTeamplay( void ) { return m_bTeamPlayEnabled; }
void CheckAllPlayersReady( void );
virtual bool IsConnectedUserInfoChangeAllowed( CBasePlayer *pPlayer );
private:
CNetworkVar( bool, m_bTeamPlayEnabled );
CNetworkVar( float, m_flGameStartTime );
CUtlVector<EHANDLE> m_hRespawnableItemsAndWeapons;
float m_tmNextPeriodicThink;
float m_flRestartGameTime;
bool m_bCompleteReset;
bool m_bAwaitingReadyRestart;
bool m_bHeardAllPlayersReady;
#ifndef CLIENT_DLL
bool m_bChangelevelDone;
#endif
};
inline CHL2MPRules* HL2MPRules()
{
return static_cast<CHL2MPRules*>(g_pGameRules);
}
#endif //HL2MP_GAMERULES_H

View File

@@ -0,0 +1,577 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#include "cbase.h"
#ifdef CLIENT_DLL
#include "c_poly_player.h"
#include "prediction.h"
#define CRecipientFilter C_RecipientFilter
#else
#include "polymorph/poly_player.h"
#endif
#include "engine/IEngineSound.h"
#include "SoundEmitterSystem/isoundemittersystembase.h"
extern ConVar sv_footsteps;
const char *g_ppszPlayerSoundPrefixNames[PLAYER_SOUNDS_MAX] =
{
"NPC_Citizen",
"NPC_CombineS",
"NPC_MetroPolice",
};
const char *CHL2MP_Player::GetPlayerModelSoundPrefix( void )
{
return g_ppszPlayerSoundPrefixNames[m_iPlayerSoundType];
}
void CHL2MP_Player::PrecacheFootStepSounds( void )
{
int iFootstepSounds = ARRAYSIZE( g_ppszPlayerSoundPrefixNames );
int i;
for ( i = 0; i < iFootstepSounds; ++i )
{
char szFootStepName[128];
Q_snprintf( szFootStepName, sizeof( szFootStepName ), "%s.RunFootstepLeft", g_ppszPlayerSoundPrefixNames[i] );
PrecacheScriptSound( szFootStepName );
Q_snprintf( szFootStepName, sizeof( szFootStepName ), "%s.RunFootstepRight", g_ppszPlayerSoundPrefixNames[i] );
PrecacheScriptSound( szFootStepName );
}
}
//-----------------------------------------------------------------------------
// Consider the weapon's built-in accuracy, this character's proficiency with
// the weapon, and the status of the target. Use this information to determine
// how accurately to shoot at the target.
//-----------------------------------------------------------------------------
Vector CHL2MP_Player::GetAttackSpread( CBaseCombatWeapon *pWeapon, CBaseEntity *pTarget )
{
if ( pWeapon )
return pWeapon->GetBulletSpread( WEAPON_PROFICIENCY_PERFECT );
return VECTOR_CONE_15DEGREES;
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : step -
// fvol -
// force - force sound to play
//-----------------------------------------------------------------------------
void CHL2MP_Player::PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force )
{
if ( gpGlobals->maxClients > 1 && !sv_footsteps.GetFloat() )
return;
#if defined( CLIENT_DLL )
// during prediction play footstep sounds only once
if ( !prediction->IsFirstTimePredicted() )
return;
#endif
if ( GetFlags() & FL_DUCKING )
return;
m_Local.m_nStepside = !m_Local.m_nStepside;
char szStepSound[128];
if ( m_Local.m_nStepside )
{
Q_snprintf( szStepSound, sizeof( szStepSound ), "%s.RunFootstepLeft", g_ppszPlayerSoundPrefixNames[m_iPlayerSoundType] );
}
else
{
Q_snprintf( szStepSound, sizeof( szStepSound ), "%s.RunFootstepRight", g_ppszPlayerSoundPrefixNames[m_iPlayerSoundType] );
}
CSoundParameters params;
if ( GetParametersForSound( szStepSound, params, NULL ) == false )
return;
CRecipientFilter filter;
filter.AddRecipientsByPAS( vecOrigin );
#ifndef CLIENT_DLL
// im MP, server removed all players in origins PVS, these players
// generate the footsteps clientside
if ( gpGlobals->maxClients > 1 )
filter.RemoveRecipientsByPVS( vecOrigin );
#endif
EmitSound_t ep;
ep.m_nChannel = CHAN_BODY;
ep.m_pSoundName = params.soundname;
ep.m_flVolume = fvol;
ep.m_SoundLevel = params.soundlevel;
ep.m_nFlags = 0;
ep.m_nPitch = params.pitch;
ep.m_pOrigin = &vecOrigin;
EmitSound( filter, entindex(), ep );
}
//==========================
// ANIMATION CODE
//==========================
// Below this many degrees, slow down turning rate linearly
#define FADE_TURN_DEGREES 45.0f
// After this, need to start turning feet
#define MAX_TORSO_ANGLE 90.0f
// Below this amount, don't play a turning animation/perform IK
#define MIN_TURN_ANGLE_REQUIRING_TURN_ANIMATION 15.0f
static ConVar tf2_feetyawrunscale( "tf2_feetyawrunscale", "2", FCVAR_REPLICATED, "Multiplier on tf2_feetyawrate to allow turning faster when running." );
extern ConVar sv_backspeed;
extern ConVar mp_feetyawrate;
extern ConVar mp_facefronttime;
extern ConVar mp_ik;
CPlayerAnimState::CPlayerAnimState( CHL2MP_Player *outer )
: m_pOuter( outer )
{
m_flGaitYaw = 0.0f;
m_flGoalFeetYaw = 0.0f;
m_flCurrentFeetYaw = 0.0f;
m_flCurrentTorsoYaw = 0.0f;
m_flLastYaw = 0.0f;
m_flLastTurnTime = 0.0f;
m_flTurnCorrectionTime = 0.0f;
};
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPlayerAnimState::Update()
{
m_angRender = GetOuter()->GetLocalAngles();
m_angRender[ PITCH ] = m_angRender[ ROLL ] = 0.0f;
ComputePoseParam_BodyYaw();
ComputePoseParam_BodyPitch(GetOuter()->GetModelPtr());
ComputePoseParam_BodyLookYaw();
ComputePlaybackRate();
#ifdef CLIENT_DLL
GetOuter()->UpdateLookAt();
#endif
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPlayerAnimState::ComputePlaybackRate()
{
// Determine ideal playback rate
Vector vel;
GetOuterAbsVelocity( vel );
float speed = vel.Length2D();
bool isMoving = ( speed > 0.5f ) ? true : false;
float maxspeed = GetOuter()->GetSequenceGroundSpeed( GetOuter()->GetSequence() );
if ( isMoving && ( maxspeed > 0.0f ) )
{
float flFactor = 1.0f;
// Note this gets set back to 1.0 if sequence changes due to ResetSequenceInfo below
GetOuter()->SetPlaybackRate( ( speed * flFactor ) / maxspeed );
// BUG BUG:
// This stuff really should be m_flPlaybackRate = speed / m_flGroundSpeed
}
else
{
GetOuter()->SetPlaybackRate( 1.0f );
}
}
//-----------------------------------------------------------------------------
// Purpose:
// Output : CBasePlayer
//-----------------------------------------------------------------------------
CHL2MP_Player *CPlayerAnimState::GetOuter()
{
return m_pOuter;
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : dt -
//-----------------------------------------------------------------------------
void CPlayerAnimState::EstimateYaw( void )
{
float dt = gpGlobals->frametime;
if ( !dt )
{
return;
}
Vector est_velocity;
QAngle angles;
GetOuterAbsVelocity( est_velocity );
angles = GetOuter()->GetLocalAngles();
if ( est_velocity[1] == 0 && est_velocity[0] == 0 )
{
float flYawDiff = angles[YAW] - m_flGaitYaw;
flYawDiff = flYawDiff - (int)(flYawDiff / 360) * 360;
if (flYawDiff > 180)
flYawDiff -= 360;
if (flYawDiff < -180)
flYawDiff += 360;
if (dt < 0.25)
flYawDiff *= dt * 4;
else
flYawDiff *= dt;
m_flGaitYaw += flYawDiff;
m_flGaitYaw = m_flGaitYaw - (int)(m_flGaitYaw / 360) * 360;
}
else
{
m_flGaitYaw = (atan2(est_velocity[1], est_velocity[0]) * 180 / M_PI);
if (m_flGaitYaw > 180)
m_flGaitYaw = 180;
else if (m_flGaitYaw < -180)
m_flGaitYaw = -180;
}
}
//-----------------------------------------------------------------------------
// Purpose: Override for backpeddling
// Input : dt -
//-----------------------------------------------------------------------------
void CPlayerAnimState::ComputePoseParam_BodyYaw( void )
{
int iYaw = GetOuter()->LookupPoseParameter( "move_yaw" );
if ( iYaw < 0 )
return;
// view direction relative to movement
float flYaw;
EstimateYaw();
QAngle angles = GetOuter()->GetLocalAngles();
float ang = angles[ YAW ];
if ( ang > 180.0f )
{
ang -= 360.0f;
}
else if ( ang < -180.0f )
{
ang += 360.0f;
}
// calc side to side turning
flYaw = ang - m_flGaitYaw;
// Invert for mapping into 8way blend
flYaw = -flYaw;
flYaw = flYaw - (int)(flYaw / 360) * 360;
if (flYaw < -180)
{
flYaw = flYaw + 360;
}
else if (flYaw > 180)
{
flYaw = flYaw - 360;
}
GetOuter()->SetPoseParameter( iYaw, flYaw );
#ifndef CLIENT_DLL
//Adrian: Make the model's angle match the legs so the hitboxes match on both sides.
GetOuter()->SetLocalAngles( QAngle( GetOuter()->GetAnimEyeAngles().x, m_flCurrentFeetYaw, 0 ) );
#endif
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPlayerAnimState::ComputePoseParam_BodyPitch( CStudioHdr *pStudioHdr )
{
// Get pitch from v_angle
float flPitch = GetOuter()->GetLocalAngles()[ PITCH ];
if ( flPitch > 180.0f )
{
flPitch -= 360.0f;
}
flPitch = clamp( flPitch, -90, 90 );
QAngle absangles = GetOuter()->GetAbsAngles();
absangles.x = 0.0f;
m_angRender = absangles;
m_angRender[ PITCH ] = m_angRender[ ROLL ] = 0.0f;
// See if we have a blender for pitch
GetOuter()->SetPoseParameter( pStudioHdr, "aim_pitch", flPitch );
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : goal -
// maxrate -
// dt -
// current -
// Output : int
//-----------------------------------------------------------------------------
int CPlayerAnimState::ConvergeAngles( float goal,float maxrate, float dt, float& current )
{
int direction = TURN_NONE;
float anglediff = goal - current;
float anglediffabs = fabs( anglediff );
anglediff = AngleNormalize( anglediff );
float scale = 1.0f;
if ( anglediffabs <= FADE_TURN_DEGREES )
{
scale = anglediffabs / FADE_TURN_DEGREES;
// Always do at least a bit of the turn ( 1% )
scale = clamp( scale, 0.01f, 1.0f );
}
float maxmove = maxrate * dt * scale;
if ( fabs( anglediff ) < maxmove )
{
current = goal;
}
else
{
if ( anglediff > 0 )
{
current += maxmove;
direction = TURN_LEFT;
}
else
{
current -= maxmove;
direction = TURN_RIGHT;
}
}
current = AngleNormalize( current );
return direction;
}
void CPlayerAnimState::ComputePoseParam_BodyLookYaw( void )
{
QAngle absangles = GetOuter()->GetAbsAngles();
absangles.y = AngleNormalize( absangles.y );
m_angRender = absangles;
m_angRender[ PITCH ] = m_angRender[ ROLL ] = 0.0f;
// See if we even have a blender for pitch
int upper_body_yaw = GetOuter()->LookupPoseParameter( "aim_yaw" );
if ( upper_body_yaw < 0 )
{
return;
}
// Assume upper and lower bodies are aligned and that we're not turning
float flGoalTorsoYaw = 0.0f;
int turning = TURN_NONE;
float turnrate = 360.0f;
Vector vel;
GetOuterAbsVelocity( vel );
bool isMoving = ( vel.Length() > 1.0f ) ? true : false;
if ( !isMoving )
{
// Just stopped moving, try and clamp feet
if ( m_flLastTurnTime <= 0.0f )
{
m_flLastTurnTime = gpGlobals->curtime;
m_flLastYaw = GetOuter()->GetAnimEyeAngles().y;
// Snap feet to be perfectly aligned with torso/eyes
m_flGoalFeetYaw = GetOuter()->GetAnimEyeAngles().y;
m_flCurrentFeetYaw = m_flGoalFeetYaw;
m_nTurningInPlace = TURN_NONE;
}
// If rotating in place, update stasis timer
if ( m_flLastYaw != GetOuter()->GetAnimEyeAngles().y )
{
m_flLastTurnTime = gpGlobals->curtime;
m_flLastYaw = GetOuter()->GetAnimEyeAngles().y;
}
if ( m_flGoalFeetYaw != m_flCurrentFeetYaw )
{
m_flLastTurnTime = gpGlobals->curtime;
}
turning = ConvergeAngles( m_flGoalFeetYaw, turnrate, gpGlobals->frametime, m_flCurrentFeetYaw );
QAngle eyeAngles = GetOuter()->GetAnimEyeAngles();
QAngle vAngle = GetOuter()->GetLocalAngles();
// See how far off current feetyaw is from true yaw
float yawdelta = GetOuter()->GetAnimEyeAngles().y - m_flCurrentFeetYaw;
yawdelta = AngleNormalize( yawdelta );
bool rotated_too_far = false;
float yawmagnitude = fabs( yawdelta );
// If too far, then need to turn in place
if ( yawmagnitude > 45 )
{
rotated_too_far = true;
}
// Standing still for a while, rotate feet around to face forward
// Or rotated too far
// FIXME: Play an in place turning animation
if ( rotated_too_far ||
( gpGlobals->curtime > m_flLastTurnTime + mp_facefronttime.GetFloat() ) )
{
m_flGoalFeetYaw = GetOuter()->GetAnimEyeAngles().y;
m_flLastTurnTime = gpGlobals->curtime;
/* float yd = m_flCurrentFeetYaw - m_flGoalFeetYaw;
if ( yd > 0 )
{
m_nTurningInPlace = TURN_RIGHT;
}
else if ( yd < 0 )
{
m_nTurningInPlace = TURN_LEFT;
}
else
{
m_nTurningInPlace = TURN_NONE;
}
turning = ConvergeAngles( m_flGoalFeetYaw, turnrate, gpGlobals->frametime, m_flCurrentFeetYaw );
yawdelta = GetOuter()->GetAnimEyeAngles().y - m_flCurrentFeetYaw;*/
}
// Snap upper body into position since the delta is already smoothed for the feet
flGoalTorsoYaw = yawdelta;
m_flCurrentTorsoYaw = flGoalTorsoYaw;
}
else
{
m_flLastTurnTime = 0.0f;
m_nTurningInPlace = TURN_NONE;
m_flCurrentFeetYaw = m_flGoalFeetYaw = GetOuter()->GetAnimEyeAngles().y;
flGoalTorsoYaw = 0.0f;
m_flCurrentTorsoYaw = GetOuter()->GetAnimEyeAngles().y - m_flCurrentFeetYaw;
}
if ( turning == TURN_NONE )
{
m_nTurningInPlace = turning;
}
if ( m_nTurningInPlace != TURN_NONE )
{
// If we're close to finishing the turn, then turn off the turning animation
if ( fabs( m_flCurrentFeetYaw - m_flGoalFeetYaw ) < MIN_TURN_ANGLE_REQUIRING_TURN_ANIMATION )
{
m_nTurningInPlace = TURN_NONE;
}
}
// Rotate entire body into position
absangles = GetOuter()->GetAbsAngles();
absangles.y = m_flCurrentFeetYaw;
m_angRender = absangles;
m_angRender[ PITCH ] = m_angRender[ ROLL ] = 0.0f;
GetOuter()->SetPoseParameter( upper_body_yaw, clamp( m_flCurrentTorsoYaw, -60.0f, 60.0f ) );
/*
// FIXME: Adrian, what is this?
int body_yaw = GetOuter()->LookupPoseParameter( "body_yaw" );
if ( body_yaw >= 0 )
{
GetOuter()->SetPoseParameter( body_yaw, 30 );
}
*/
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : activity -
// Output : Activity
//-----------------------------------------------------------------------------
Activity CPlayerAnimState::BodyYawTranslateActivity( Activity activity )
{
// Not even standing still, sigh
if ( activity != ACT_IDLE )
return activity;
// Not turning
switch ( m_nTurningInPlace )
{
default:
case TURN_NONE:
return activity;
/*
case TURN_RIGHT:
return ACT_TURNRIGHT45;
case TURN_LEFT:
return ACT_TURNLEFT45;
*/
case TURN_RIGHT:
case TURN_LEFT:
return mp_ik.GetBool() ? ACT_TURN : activity;
}
Assert( 0 );
return activity;
}
const QAngle& CPlayerAnimState::GetRenderAngles()
{
return m_angRender;
}
void CPlayerAnimState::GetOuterAbsVelocity( Vector& vel )
{
#if defined( CLIENT_DLL )
GetOuter()->EstimateAbsVelocity( vel );
#else
vel = GetOuter()->GetAbsVelocity();
#endif
}

View File

@@ -0,0 +1,97 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#ifndef HL2MP_PLAYER_SHARED_H
#define HL2MP_PLAYER_SHARED_H
#pragma once
#define HL2MP_PUSHAWAY_THINK_INTERVAL (1.0f / 20.0f)
#include "studio.h"
enum
{
PLAYER_SOUNDS_CITIZEN = 0,
PLAYER_SOUNDS_COMBINESOLDIER,
PLAYER_SOUNDS_METROPOLICE,
PLAYER_SOUNDS_MAX,
};
enum HL2MPPlayerState
{
// Happily running around in the game.
STATE_ACTIVE=0,
STATE_OBSERVER_MODE, // Noclipping around, watching players, etc.
NUM_PLAYER_STATES
};
#if defined( CLIENT_DLL )
#define CHL2MP_Player C_HL2MP_Player
#endif
class CPlayerAnimState
{
public:
enum
{
TURN_NONE = 0,
TURN_LEFT,
TURN_RIGHT
};
CPlayerAnimState( CHL2MP_Player *outer );
Activity BodyYawTranslateActivity( Activity activity );
void Update();
const QAngle& GetRenderAngles();
void GetPoseParameters( CStudioHdr *pStudioHdr, float poseParameter[MAXSTUDIOPOSEPARAM] );
CHL2MP_Player *GetOuter();
private:
void GetOuterAbsVelocity( Vector& vel );
int ConvergeAngles( float goal,float maxrate, float dt, float& current );
void EstimateYaw( void );
void ComputePoseParam_BodyYaw( void );
void ComputePoseParam_BodyPitch( CStudioHdr *pStudioHdr );
void ComputePoseParam_BodyLookYaw( void );
void ComputePlaybackRate();
CHL2MP_Player *m_pOuter;
float m_flGaitYaw;
float m_flStoredCycle;
// The following variables are used for tweaking the yaw of the upper body when standing still and
// making sure that it smoothly blends in and out once the player starts moving
// Direction feet were facing when we stopped moving
float m_flGoalFeetYaw;
float m_flCurrentFeetYaw;
float m_flCurrentTorsoYaw;
// To check if they are rotating in place
float m_flLastYaw;
// Time when we stopped moving
float m_flLastTurnTime;
// One of the above enums
int m_nTurningInPlace;
QAngle m_angRender;
float m_flTurnCorrectionTime;
};
#endif //HL2MP_PLAYER_SHARED_h

View File

@@ -0,0 +1,41 @@
#include "cbase.h"
#include "poly_playerlocaldata.h"
#ifndef CLIENT_DLL
#include "mathlib/mathlib.h"
#include "entitylist.h"
#endif
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#ifdef CLIENT_DLL
#pragma message("CPolyPlayerLocalData Client pass")
BEGIN_RECV_TABLE_NOBASE( CPolyPlayerLocalData, DT_PolyLocal )
RecvPropInt( RECVINFO(m_iPolyLevel) ),
RecvPropInt( RECVINFO(m_iExpPerLevel) )
END_RECV_TABLE()
#else
#pragma message("CPolyPlayerLocalData Server pass")
BEGIN_SEND_TABLE_NOBASE( CPolyPlayerLocalData, DT_PolyLocal )
SendPropInt( SENDINFO(m_iPolyLevel) ),
SendPropInt( SENDINFO(m_iExpPerLevel) )
END_SEND_TABLE()
BEGIN_SIMPLE_DATADESC( CPolyPlayerLocalData )
DEFINE_FIELD( m_iPolyLevel, FIELD_INTEGER ),
DEFINE_FIELD( m_iExpPerLevel, FIELD_INTEGER ),
END_DATADESC()
#endif
CPolyPlayerLocalData::CPolyPlayerLocalData()
{
m_iPolyLevel=0;
m_iExpPerLevel=0;
}

View File

@@ -0,0 +1,36 @@
#if !defined( POLY_PLAYERLOCALDATA_H )
#define POLY_PLAYERLOCALDATA_H
#ifdef _WIN32
#pragma once
#endif
#include "dt_recv.h"
#include "poly_shareddefs.h"
#ifdef CLIENT_DLL
EXTERN_RECV_TABLE( DT_PolyLocal );
#define CPolyPlayerLocalData C_PolyPlayerLocalData
#else
EXTERN_SEND_TABLE( DT_PolyLocal );
#endif
class CPolyPlayerLocalData
{
public:
#ifndef CLIENT_DLL
DECLARE_SIMPLE_DATADESC();
#endif
DECLARE_CLASS_NOBASE( CPolyPlayerLocalData );
DECLARE_EMBEDDED_NETWORKVAR();
CPolyPlayerLocalData();
CNetworkVar( unsigned short, m_iPolyLevel);
CNetworkVar( int, m_iExpPerLevel);
};
#endif

View File

@@ -0,0 +1,27 @@
#pragma once
#define MAX_POLYLEVEL 10
#define EXP_PER_CUBE 5
struct ExpPerLevel
{
int exp; // how much xp needed to go on next level
bool thirdperson;
float player_scale;
float player_speed;
};
static const ExpPerLevel g_iaTableExpPerLevel[MAX_POLYLEVEL] =
{
{20, true, 0.7, 0.1},
{40, false, 0.8, 0.7},
{80, false, 0.9, 0.7},
{100, false, 1, 0.8},
{120, false, 1.1, 1},
{140, false, 1.2, 1},
{180, false, 1.3, 1},
{200, false, 1.4, 1},
{250, false, 1.5, 1},
{300, false, 1.6, 1},
};

View File

@@ -0,0 +1,57 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "usermessages.h"
#include "shake.h"
#include "voice_gamemgr.h"
// NVNT include to register in haptic user messages
#include "haptics/haptic_msgs.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
void RegisterUserMessages( void )
{
usermessages->Register( "Geiger", 1 );
usermessages->Register( "Train", 1 );
usermessages->Register( "HudText", -1 );
usermessages->Register( "SayText", -1 );
usermessages->Register( "SayText2", -1 );
usermessages->Register( "TextMsg", -1 );
usermessages->Register( "HudMsg", -1 );
usermessages->Register( "ResetHUD", 1); // called every respawn
usermessages->Register( "GameTitle", 0 );
usermessages->Register( "ItemPickup", -1 );
usermessages->Register( "ShowMenu", -1 );
usermessages->Register( "Shake", 13 );
usermessages->Register( "Fade", 10 );
usermessages->Register( "VGUIMenu", -1 ); // Show VGUI menu
usermessages->Register( "Rumble", 3 ); // Send a rumble to a controller
usermessages->Register( "Battery", 2 );
usermessages->Register( "Damage", 18 ); // BUG: floats are sent for coords, no variable bitfields in hud & fixed size Msg
usermessages->Register( "VoiceMask", VOICE_MAX_PLAYERS_DW*4 * 2 + 1 );
usermessages->Register( "RequestState", 0 );
usermessages->Register( "CloseCaption", -1 ); // Show a caption (by string id number)(duration in 10th of a second)
usermessages->Register( "HintText", -1 ); // Displays hint text display
usermessages->Register( "KeyHintText", -1 ); // Displays hint text display
usermessages->Register( "SquadMemberDied", 0 );
usermessages->Register( "AmmoDenied", 2 );
usermessages->Register( "CreditsMsg", 1 );
usermessages->Register( "LogoTimeMsg", 4 );
usermessages->Register( "AchievementEvent", -1 );
usermessages->Register( "UpdateJalopyRadar", -1 );
usermessages->Register( "EnableThirdPerson" ,-1);
usermessages->Register( "DisableThirdPerson" ,-1);
#ifndef _X360
// NVNT register haptic user messages
RegisterHapticMessages();
#endif
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -11,6 +11,7 @@
$Games $Games
{ {
"HL2MP" "HL2MP"
"Polymorph"
} }
// Makes the VPC scripts work in the SDK's context // Makes the VPC scripts work in the SDK's context

View File

@@ -17,6 +17,7 @@ $Project "captioncompiler"
$Project "client" $Project "client"
{ {
"game\client\client_hl2mp.vpc" [($WIN32||$POSIX) && $HL2MP] "game\client\client_hl2mp.vpc" [($WIN32||$POSIX) && $HL2MP]
"game\client\client_polymorph.vpc" [($WIN32||$POSIX) && $Polymorph]
} }
$Project "fgdlib" $Project "fgdlib"
@@ -42,6 +43,7 @@ $Project "height2normal"
$Project "server" $Project "server"
{ {
"game\server\server_hl2mp.vpc" [($WIN32||$POSIX) && $HL2MP] "game\server\server_hl2mp.vpc" [($WIN32||$POSIX) && $HL2MP]
"game\server\server_polymorph.vpc" [($WIN32||$POSIX) && $Polymorph]
} }
$Project "mathlib" $Project "mathlib"