├── .github └── workflows │ ├── GLuaLint.yml │ ├── WorkshopPublish.yml │ ├── WorkshopPublishRelease.yml │ └── WorkshopPublishTest.yml ├── .glualint.json ├── CI └── PreparePackage.sh ├── LICENSE.md ├── README.md ├── addon.json ├── art └── lambda512.jpg ├── backgrounds └── 1.jpg ├── changelog.md ├── content ├── materials │ ├── killicons │ │ ├── combine_mine_killicon.vmt │ │ ├── combine_mine_killicon.vtf │ │ ├── env_explosion_killicon.vmt │ │ ├── env_explosion_killicon.vtf │ │ ├── env_fire_killicon.vmt │ │ ├── env_fire_killicon.vtf │ │ ├── env_laser_killicon.vmt │ │ ├── env_laser_killicon.vtf │ │ ├── func_door_killicon.vmt │ │ ├── func_door_killicon.vtf │ │ ├── func_physbox_killicon.vmt │ │ ├── func_physbox_killicon.vtf │ │ ├── npc_barnacle_killicon.vmt │ │ ├── npc_barnacle_killicon.vtf │ │ ├── npc_manhack_killicon.vmt │ │ ├── npc_manhack_killicon.vtf │ │ ├── point_hurt_killicon.vmt │ │ ├── point_hurt_killicon.vtf │ │ ├── radiation_killicon.vmt │ │ ├── radiation_killicon.vtf │ │ ├── worldspawn_killicon.vmt │ │ └── worldspawn_killicon.vtf │ ├── lambda │ │ ├── blocked.vmt │ │ ├── blocked.vtf │ │ ├── checkpoint.vmt │ │ ├── checkpoint.vtf │ │ ├── cross.png │ │ ├── death_point.vmt │ │ ├── death_point.vtf │ │ ├── failed.png │ │ ├── icons │ │ │ ├── admin_settings.png │ │ │ ├── gun.png │ │ │ ├── help.png │ │ │ ├── info.png │ │ │ ├── ping.png │ │ │ ├── player_settings.png │ │ │ ├── poll.png │ │ │ ├── settings.png │ │ │ ├── skull.png │ │ │ ├── sort2.png │ │ │ ├── sort3.png │ │ │ ├── stopwatch.png │ │ │ └── tick.png │ │ ├── logo_512.png │ │ ├── ring1.png │ │ ├── ring2.png │ │ ├── ring3.png │ │ ├── run_point.vmt │ │ ├── run_point.vtf │ │ ├── success.png │ │ ├── uiskin.png │ │ ├── vehicle.vmt │ │ └── vehicle.vtf │ ├── models │ │ └── decay │ │ │ └── cockroach │ │ │ ├── roach.vmt │ │ │ └── roach.vtf │ ├── nature │ │ └── toxicslime002a.vmt │ └── sprites │ │ ├── physcannon_beam.vmt │ │ ├── physcannon_blast.vmt │ │ ├── physcannon_core.vmt │ │ ├── physcannon_glow1.vmt │ │ ├── physcannon_glow1noz.vmt │ │ └── physcannon_glow2.vmt ├── models │ ├── barney_animat_ep1.ani │ ├── barney_animat_ep1.mdl │ ├── barney_animat_hl2.ani │ ├── barney_animat_hl2.mdl │ ├── barney_animations.mdl │ ├── barney_gest_ep1.ani │ ├── barney_gest_ep1.mdl │ ├── barney_gest_ep2.ani │ ├── barney_gest_ep2.mdl │ ├── barney_gest_hl2.ani │ ├── barney_gest_hl2.mdl │ ├── barney_gestures.mdl │ ├── barney_post_ep1.ani │ ├── barney_post_ep1.mdl │ ├── barney_post_hl2.ani │ ├── barney_post_hl2.mdl │ ├── barney_postures.mdl │ └── decay │ │ ├── cockroach.dx80.vtx │ │ ├── cockroach.dx90.vtx │ │ ├── cockroach.mdl │ │ └── cockroach.vvd └── sound │ ├── lambda │ ├── defibrillator_charge.wav │ ├── defibrillator_release.wav │ ├── physics │ │ └── flesh │ │ │ ├── flesh_impact_bullet1.wav │ │ │ ├── flesh_impact_bullet2.wav │ │ │ ├── flesh_impact_bullet3.wav │ │ │ ├── flesh_impact_bullet4.wav │ │ │ └── flesh_impact_bullet5.wav │ └── roundover.mp3 │ └── roach │ ├── rch_die.wav │ ├── rch_smash.wav │ └── rch_walk.wav ├── data ├── ep2 │ └── credits.txt ├── episodic │ └── credits.txt └── hl2 │ └── credits.txt ├── entities ├── effects │ ├── lambda_blood_explosion.lua │ ├── lambda_death.lua │ ├── lambda_physcannon_impact.lua │ └── lambda_pointer.lua ├── entities │ ├── base_gmodentity.lua │ ├── env_credits.lua │ ├── env_hudhint.lua │ ├── env_screenoverlay.lua │ ├── env_zoom.lua │ ├── info_npc_spawn_destination.lua │ ├── lambda_checkpoint.lua │ ├── lambda_client_sound.lua │ ├── lambda_clientcommand.lua │ ├── lambda_cockroach_manager.lua │ ├── lambda_entity.lua │ ├── lambda_lua_logic.lua │ ├── lambda_motioncontroller.lua │ ├── lambda_npc_interactions.lua │ ├── lambda_npcmaker.lua │ ├── lambda_path_tracker.lua │ ├── lambda_player_tracker.lua │ ├── lambda_ragdollmanager.lua │ ├── lambda_trigger.lua │ ├── lambda_vehicle_companion.lua │ ├── lambda_vehicle_tracker.lua │ ├── logic_auto.lua │ ├── npc_lambda_cockroach.lua │ ├── npc_maker.lua │ ├── npc_template_maker.lua │ ├── player_loadsaved.lua │ ├── player_speedmod.lua │ ├── point_teleport.lua │ ├── point_viewcontrol.lua │ ├── prop_physics_respawnable.lua │ ├── trigger_auto.lua │ ├── trigger_changelevel.lua │ ├── trigger_hurt.lua │ ├── trigger_multiple.lua │ ├── trigger_once.lua │ ├── trigger_teleport.lua │ └── trigger_transition.lua └── weapons │ ├── weapon_lambda_medkit.lua │ └── weapon_physcannon.lua ├── gamemode ├── cl_hud.lua ├── cl_init.lua ├── cl_lang.lua ├── cl_postprocess.lua ├── cl_ragdoll_ext.lua ├── cl_skin_lambda.lua ├── cl_taunts.lua ├── gametypes │ ├── base │ │ └── cl_localisation.lua │ ├── gametype_base.lua │ ├── hl1s.lua │ ├── hl1s │ │ ├── cl_localisation.lua │ │ └── mapscripts │ │ │ ├── c0a0.lua │ │ │ ├── c0a0a.lua │ │ │ ├── c0a0b.lua │ │ │ ├── c0a0c.lua │ │ │ ├── c0a0d.lua │ │ │ ├── c0a0e.lua │ │ │ ├── c1a0.lua │ │ │ ├── c1a0a.lua │ │ │ ├── c1a0b.lua │ │ │ ├── c1a0d.lua │ │ │ ├── c1a0e.lua │ │ │ └── template.lua │ ├── hl2.lua │ ├── hl2 │ │ ├── cl_localisation.lua │ │ └── mapscripts │ │ │ ├── d1_canals_01.lua │ │ │ ├── d1_canals_01a.lua │ │ │ ├── d1_canals_02.lua │ │ │ ├── d1_canals_03.lua │ │ │ ├── d1_canals_05.lua │ │ │ ├── d1_canals_06.lua │ │ │ ├── d1_canals_07.lua │ │ │ ├── d1_canals_08.lua │ │ │ ├── d1_canals_09.lua │ │ │ ├── d1_canals_10.lua │ │ │ ├── d1_canals_11.lua │ │ │ ├── d1_canals_12.lua │ │ │ ├── d1_canals_13.lua │ │ │ ├── d1_eli_01.lua │ │ │ ├── d1_eli_02.lua │ │ │ ├── d1_town_01.lua │ │ │ ├── d1_town_01a.lua │ │ │ ├── d1_town_02.lua │ │ │ ├── d1_town_02a.lua │ │ │ ├── d1_town_03.lua │ │ │ ├── d1_town_04.lua │ │ │ ├── d1_town_05.lua │ │ │ ├── d1_trainstation_01.lua │ │ │ ├── d1_trainstation_02.lua │ │ │ ├── d1_trainstation_03.lua │ │ │ ├── d1_trainstation_04.lua │ │ │ ├── d1_trainstation_05.lua │ │ │ ├── d1_trainstation_06.lua │ │ │ ├── d2_coast_01.lua │ │ │ ├── d2_coast_03.lua │ │ │ ├── d2_coast_04.lua │ │ │ ├── d2_coast_05.lua │ │ │ ├── d2_coast_07.lua │ │ │ ├── d2_coast_08.lua │ │ │ ├── d2_coast_09.lua │ │ │ ├── d2_coast_10.lua │ │ │ ├── d2_coast_11.lua │ │ │ ├── d2_coast_12.lua │ │ │ ├── d2_prison_01.lua │ │ │ ├── d2_prison_02.lua │ │ │ ├── d2_prison_03.lua │ │ │ ├── d2_prison_04.lua │ │ │ ├── d2_prison_05.lua │ │ │ ├── d2_prison_06.lua │ │ │ ├── d2_prison_07.lua │ │ │ ├── d2_prison_08.lua │ │ │ ├── d3_breen_01.lua │ │ │ ├── d3_c17_01.lua │ │ │ ├── d3_c17_02.lua │ │ │ ├── d3_c17_03.lua │ │ │ ├── d3_c17_04.lua │ │ │ ├── d3_c17_05.lua │ │ │ ├── d3_c17_06a.lua │ │ │ ├── d3_c17_06b.lua │ │ │ ├── d3_c17_07.lua │ │ │ ├── d3_c17_08.lua │ │ │ ├── d3_c17_09.lua │ │ │ ├── d3_c17_10a.lua │ │ │ ├── d3_c17_10b.lua │ │ │ ├── d3_c17_11.lua │ │ │ ├── d3_c17_12.lua │ │ │ ├── d3_c17_12b.lua │ │ │ ├── d3_c17_13.lua │ │ │ ├── d3_citadel_01.lua │ │ │ ├── d3_citadel_02.lua │ │ │ ├── d3_citadel_03.lua │ │ │ ├── d3_citadel_04.lua │ │ │ ├── d3_citadel_05.lua │ │ │ └── template.lua │ ├── hl2dm.lua │ ├── hl2dm │ │ └── cl_localisation.lua │ ├── hl2ep1.lua │ ├── hl2ep1 │ │ ├── cl_localisation.lua │ │ └── mapscripts │ │ │ ├── ep1_c17_00.lua │ │ │ ├── ep1_c17_00a.lua │ │ │ ├── ep1_c17_01.lua │ │ │ ├── ep1_c17_02.lua │ │ │ ├── ep1_c17_02a.lua │ │ │ ├── ep1_c17_02b.lua │ │ │ ├── ep1_c17_05.lua │ │ │ ├── ep1_c17_06.lua │ │ │ ├── ep1_citadel_00.lua │ │ │ ├── ep1_citadel_01.lua │ │ │ ├── ep1_citadel_02.lua │ │ │ ├── ep1_citadel_02b.lua │ │ │ ├── ep1_citadel_03.lua │ │ │ └── ep1_citadel_04.lua │ ├── hl2ep2.lua │ └── hl2ep2 │ │ ├── cl_localisation.lua │ │ └── mapscripts │ │ ├── ep2_outland_01.lua │ │ ├── ep2_outland_01a.lua │ │ ├── ep2_outland_02.lua │ │ ├── ep2_outland_03.lua │ │ ├── ep2_outland_04.lua │ │ ├── ep2_outland_05.lua │ │ ├── ep2_outland_06.lua │ │ ├── ep2_outland_06a.lua │ │ ├── ep2_outland_07.lua │ │ ├── ep2_outland_08.lua │ │ ├── ep2_outland_09.lua │ │ ├── ep2_outland_10.lua │ │ ├── ep2_outland_10a.lua │ │ ├── ep2_outland_11.lua │ │ ├── ep2_outland_11a.lua │ │ ├── ep2_outland_11b.lua │ │ ├── ep2_outland_12.lua │ │ └── ep2_outland_12a.lua ├── huds │ ├── hud_ammo.lua │ ├── hud_armor.lua │ ├── hud_aux.lua │ ├── hud_credits.lua │ ├── hud_crosshair.lua │ ├── hud_deathnotice.lua │ ├── hud_health.lua │ ├── hud_hint.lua │ ├── hud_lambda.lua │ ├── hud_lambda_admin.lua │ ├── hud_lambda_info.lua │ ├── hud_lambda_player.lua │ ├── hud_lambda_settings.lua │ ├── hud_lambda_vote.lua │ ├── hud_numeric.lua │ ├── hud_pickup.lua │ ├── hud_primary_ammo.lua │ ├── hud_quickinfo.lua │ ├── hud_roundinfo.lua │ ├── hud_scoreboard.lua │ ├── hud_secondary_ammo.lua │ ├── hud_suit.lua │ └── hud_vote.lua ├── init.lua ├── sh_admin_config.lua ├── sh_animations.lua ├── sh_bullets.lua ├── sh_collisions.lua ├── sh_compatibility.lua ├── sh_convars.lua ├── sh_debug.lua ├── sh_difficulty.lua ├── sh_entity_extend.lua ├── sh_ents_extend.lua ├── sh_gametypes.lua ├── sh_globalstate.lua ├── sh_gma.lua ├── sh_hudhint.lua ├── sh_interpvalue.lua ├── sh_lambda.lua ├── sh_lambda_build.lua ├── sh_lambda_npc.lua ├── sh_lambda_player.lua ├── sh_mapdata.lua ├── sh_maplist.lua ├── sh_metrics.lua ├── sh_npc_extend.lua ├── sh_player_extend.lua ├── sh_player_list.lua ├── sh_playermodels.lua ├── sh_roundsystem.lua ├── sh_settings.lua ├── sh_sound_env.lua ├── sh_spectate.lua ├── sh_string_extend.lua ├── sh_surfaceproperties.lua ├── sh_taunts.lua ├── sh_temp.lua ├── sh_timestamp.lua ├── sh_userauth.lua ├── sh_utils.lua ├── sh_vehicles.lua ├── sh_voting.lua ├── sh_weapon_extend.lua ├── shared.lua ├── sv_changelevel.lua ├── sv_checkpoints.lua ├── sv_commands.lua ├── sv_damage.lua ├── sv_inputoutput.lua ├── sv_player_pickup.lua ├── sv_playerspeech.lua ├── sv_resource.lua ├── sv_taunts.lua ├── sv_transition.lua ├── sv_votefuncs.lua └── sv_weapontracking.lua ├── icon24.png ├── lambda.txt └── logo.png /.github/workflows/GLuaLint.yml: -------------------------------------------------------------------------------- 1 | name: GLuaLint 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | Lint: 8 | uses: FPtje/GLuaFixer/.github/workflows/glualint.yml@master -------------------------------------------------------------------------------- /.github/workflows/WorkshopPublish.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_call: 3 | inputs: 4 | workshop-id: 5 | required: true 6 | type: string 7 | secrets: 8 | STEAM_USERNAME: 9 | required: true 10 | STEAM_CONFIG_VDF: 11 | required: true 12 | jobs: 13 | Workshop-Update: 14 | name: Workshop Update 15 | runs-on: ubuntu-latest 16 | strategy: 17 | fail-fast: false 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v3 21 | - name: Fetch .NET 8 22 | run: | 23 | sudo apt update 24 | sudo apt install dotnet8 25 | - name: Fetch DepotDownloader 26 | run: | 27 | wget https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.7.4/DepotDownloader-linux-x64.zip 28 | unzip DepotDownloader-linux-x64.zip -d tools 29 | - name: Fetch GMAD 30 | run: | 31 | echo "bin/gmad_linux" > gmad_files.txt 32 | chmod +x ./tools/DepotDownloader 33 | ./tools/DepotDownloader -app 4020 -depot 4023 -filelist gmad_files.txt -dir gmod 34 | chmod +x ./gmod/bin/gmad_linux 35 | - name: Prepare package 36 | run: | 37 | ./CI/PreparePackage.sh 38 | - name: Patch Workshop Info 39 | run: | 40 | LAMBDA_VERSION=$(echo "${{ github.ref_name }}" | awk 'match($0, /^([^-]*)\/(.*)$/, a) {print a[2]}'); 41 | if [[ -z "$LAMBDA_VERSION" ]]; then 42 | echo "Not a release version, fallback to 'develop'" 43 | LAMBDA_VERSION="develop" 44 | fi 45 | echo -e '\n-- Generated by CI' >> publish/gamemodes/lambda/gamemode/sh_lambda_build.lua 46 | echo -e 'GM.WorkshopID = "${{ inputs.workshop-id }}"' >> publish/gamemodes/lambda/gamemode/sh_lambda_build.lua 47 | echo -e 'GM.WorkshopBuild = true' >> publish/gamemodes/lambda/gamemode/sh_lambda_build.lua 48 | echo -e "GM.Version = \"$LAMBDA_VERSION\"" >> publish/gamemodes/lambda/gamemode/sh_lambda_build.lua 49 | - name: Dump Workshop Info 50 | run: | 51 | cat publish/gamemodes/lambda/gamemode/sh_lambda_build.lua 52 | - name: Create GMA 53 | run: | 54 | mkdir dist 55 | ./gmod/bin/gmad_linux create -folder publish -out dist/lambda.gma 56 | - name: Upload to Workshop 57 | uses: m00nl1ght-dev/steam-workshop-deploy@v3 58 | with: 59 | username: ${{ secrets.STEAM_USERNAME }} 60 | configVdf: ${{ secrets.STEAM_CONFIG_VDF }} 61 | changenote: "List of changes: https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}/changelog.md" 62 | path: 'dist' 63 | appId: 4000 64 | publishedFileId: ${{ inputs.workshop-id }} -------------------------------------------------------------------------------- /.github/workflows/WorkshopPublishRelease.yml: -------------------------------------------------------------------------------- 1 | name: Workshop Update - Release 2 | on: 3 | push: 4 | branches: 5 | - 'release/**' 6 | jobs: 7 | Workshop-Publish-Release: 8 | uses: ./.github/workflows/WorkshopPublish.yml 9 | with: 10 | workshop-id: '780244493' 11 | secrets: inherit -------------------------------------------------------------------------------- /.github/workflows/WorkshopPublishTest.yml: -------------------------------------------------------------------------------- 1 | name: Workshop Update - Test 2 | on: 3 | push: 4 | branches: 5 | - develop 6 | jobs: 7 | Workshop-Publish-Test: 8 | uses: ./.github/workflows/WorkshopPublish.yml 9 | with: 10 | workshop-id: '801875828' 11 | secrets: inherit -------------------------------------------------------------------------------- /.glualint.json: -------------------------------------------------------------------------------- 1 | { 2 | "lint_maxScopeDepth": 12, 3 | "lint_syntaxErrors": true, 4 | "lint_syntaxInconsistencies": true, 5 | "lint_deprecated": true, 6 | "lint_trailingWhitespace": true, 7 | "lint_whitespaceStyle": true, 8 | "lint_beginnerMistakes": true, 9 | "lint_emptyBlocks": true, 10 | "lint_shadowing": true, 11 | "lint_gotos": true, 12 | "lint_goto_identifier": true, 13 | "lint_doubleNegations": true, 14 | "lint_redundantIfStatements": false, 15 | "lint_redundantParentheses": true, 16 | "lint_duplicateTableKeys": true, 17 | "lint_profanity": true, 18 | "lint_unusedVars": true, 19 | "lint_unusedParameters": false, 20 | "lint_unusedLoopVars": false, 21 | "lint_inconsistentVariableStyle": false, 22 | "lint_spaceBetweenParens": false, 23 | "lint_spaceBetweenBrackets": false, 24 | "lint_spaceBetweenBraces": false, 25 | "lint_ignoreFiles": [], 26 | "lint_spaceBeforeComma": false, 27 | "lint_spaceAfterComma": false, 28 | "lint_maxLineLength": 0, 29 | 30 | "prettyprint_spaceBetweenParens": false, 31 | "prettyprint_spaceBetweenBrackets": false, 32 | "prettyprint_spaceBetweenBraces": false, 33 | "prettyprint_spaceEmptyParens": false, 34 | "prettyprint_spaceEmptyBraces": false, 35 | "prettyprint_spaceAfterLabel": false, 36 | "prettyprint_spaceBeforeComma": false, 37 | "prettyprint_spaceAfterComma": true, 38 | "prettyprint_semicolons": false, 39 | "prettyprint_cStyle": false, 40 | "prettyprint_removeRedundantParens": true, 41 | "prettyprint_minimizeParens": false, 42 | "prettyprint_assumeOperatorAssociativity": true, 43 | "prettyprint_rejectInvalidCode": false, 44 | "prettyprint_indentation": " ", 45 | 46 | "log_format": "auto" 47 | } 48 | -------------------------------------------------------------------------------- /CI/PreparePackage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -rf publish 3 | mkdir publish 4 | 5 | mkdir publish/data_static 6 | mkdir publish/gamemodes 7 | mkdir publish/gamemodes/lambda 8 | 9 | cp -R backgrounds/ publish/gamemodes/lambda/backgrounds/ 10 | cp -R gamemode/ publish/gamemodes/lambda/gamemode/ 11 | cp -R content/* publish/ 12 | cp -R entities/ publish/gamemodes/lambda/entities/ 13 | cp -R data/* publish/data_static/ 14 | 15 | cp addon.json publish/addon.json 16 | cp icon24.png publish/gamemodes/lambda/icon24.png 17 | cp logo.png publish/gamemodes/lambda/logo.png 18 | cp lambda.txt publish/gamemodes/lambda/lambda.txt 19 | cp changelog.md publish/gamemodes/lambda/changelog.txt -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 ζeh Matt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Lambda](https://github.com/ZehMatt/Lambda/blob/develop/logo.png?raw=true) 2 | 3 | Have you ever wanted to play the Half-Life 2 series with your friends online? Then Lambda is exactly what you are looking for. Lambda aims to provide seamless multiplayer support for the Half-Life 2 campaign maps, as well as user-created campaigns. 4 | 5 | ## Features 6 | - Level scenes reworked with checkpoints to be multiplayer friendly, players won't be forcibly teleported 7 | - Full player and object transitioning between levels 8 | - Enemy scaling based on skill level and player count 9 | - Visual improvements 10 | - Legacy Half-Life 2 aspects such as view bob, view lag, sprinting, AUX power counter, and more 11 | - Survivor mode with respawn checkpoints 12 | - Ability to command friendly NPCs via the context menu 13 | - Medkits for players to heal eachother 14 | - Dynamic crosshair 15 | - Underwater bullets 16 | - Custom Gravity Gun including the mega version with glow color customization 17 | - Passenger seats 18 | - Voting system 19 | - Mapscripts for each campaign map for modifying logic and extra gameplay enhancements 20 | - Ability to create your own story 21 | - Some hidden and not so hidden easter eggs 22 | 23 | ## Supported Games 24 | 25 | Half-Life 2 26 | - Fully supported. 27 | 28 | Half-Life 2: Episode 1 29 | - Fully supported. 30 | 31 | Half-Life 2: Episode 2 32 | - 80% completion. 33 | 34 | Half-Life 2: Deathmatch 35 | - Fully supported. 36 | 37 | Half-Life 1/Source 38 | - Experimental. 39 | 40 | ## Campaign/Story Creation 41 | This is currently a work-in-progress, but will be documented soon. Here are the current specifications: 42 | 1. Whatever Half-Life 2 uses already works 43 | 2. For transition support, your map must have an info_landmark, trigger_transition, and trigger_changelevel. Check out the Valve Developer Wiki for more information 44 | 3. Information about round setup and other basic rules 45 | 46 | 47 | This is the Lambda code repository, for more information you can use following links: 48 | 49 | [Steam Workshop](http://steamcommunity.com/sharedfiles/filedetails/?id=780244493) 50 | [Discord](https://discord.gg/K42JUbC) -------------------------------------------------------------------------------- /addon.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Lambda", 3 | "tags": [ 4 | "fun", 5 | "realism" 6 | ], 7 | "title": "Lambda", 8 | "type": "gamemode" 9 | } -------------------------------------------------------------------------------- /art/lambda512.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/art/lambda512.jpg -------------------------------------------------------------------------------- /backgrounds/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/backgrounds/1.jpg -------------------------------------------------------------------------------- /content/materials/killicons/combine_mine_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/combine_mine_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/combine_mine_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/combine_mine_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/env_explosion_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/env_explosion_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/env_explosion_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/env_explosion_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/env_fire_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/env_fire_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/env_fire_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/env_fire_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/env_laser_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/env_laser_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/env_laser_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/env_laser_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/func_door_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/func_door_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/func_door_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/func_door_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/func_physbox_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/func_physbox_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/func_physbox_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/func_physbox_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/npc_barnacle_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/npc_barnacle_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/npc_barnacle_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/npc_barnacle_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/npc_manhack_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/npc_manhack_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/npc_manhack_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/npc_manhack_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/point_hurt_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/point_hurt_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/point_hurt_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/point_hurt_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/radiation_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/radiation_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/radiation_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/radiation_killicon.vtf -------------------------------------------------------------------------------- /content/materials/killicons/worldspawn_killicon.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "killicons/worldspawn_killicon" 4 | "$vertexalpha" 1 5 | "$vertexcolor" 1 6 | } 7 | -------------------------------------------------------------------------------- /content/materials/killicons/worldspawn_killicon.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/killicons/worldspawn_killicon.vtf -------------------------------------------------------------------------------- /content/materials/lambda/blocked.vmt: -------------------------------------------------------------------------------- 1 | "LightmappedGeneric" 2 | { 3 | "$basetexture" "lambda/blocked.vtf" 4 | "$receiveflashlight" "1" 5 | "$selfillum" "1" 6 | "$translucent" "1" 7 | "$alpha" "1" 8 | 9 | Proxies 10 | { 11 | Sine // a proxy which produces a sine wave 12 | { 13 | resultVar $alpha // The shader parameter to be manipulated 14 | sineperiod 1 15 | sinemin 0.3 16 | sinemax 0.7 17 | } 18 | 19 | TextureScroll 20 | { 21 | textureScrollVar $basetexturetransform 22 | textureScrollRate 0.1 23 | textureScrollAngle 70 24 | } 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /content/materials/lambda/blocked.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/blocked.vtf -------------------------------------------------------------------------------- /content/materials/lambda/checkpoint.vmt: -------------------------------------------------------------------------------- 1 | "MonitorScreen" 2 | { 3 | "$basetexture" "lambda/checkpoint" 4 | "$translucent" 1 5 | "$saturation" "0" 6 | "$contrast" "1" 7 | "$tint" "[1 1 1]" 8 | "$ignorez" "0" 9 | } 10 | -------------------------------------------------------------------------------- /content/materials/lambda/checkpoint.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/checkpoint.vtf -------------------------------------------------------------------------------- /content/materials/lambda/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/cross.png -------------------------------------------------------------------------------- /content/materials/lambda/death_point.vmt: -------------------------------------------------------------------------------- 1 | "MonitorScreen" 2 | { 3 | "$basetexture" "lambda/death_point" 4 | "$translucent" 1 5 | "$saturation" "0" 6 | "$contrast" "1" 7 | "$tint" "[1 1 1]" 8 | "$ignorez" "0" 9 | } 10 | -------------------------------------------------------------------------------- /content/materials/lambda/death_point.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/death_point.vtf -------------------------------------------------------------------------------- /content/materials/lambda/failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/failed.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/admin_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/admin_settings.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/gun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/gun.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/help.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/info.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/ping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/ping.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/player_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/player_settings.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/poll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/poll.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/settings.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/skull.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/sort2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/sort2.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/sort3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/sort3.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/stopwatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/stopwatch.png -------------------------------------------------------------------------------- /content/materials/lambda/icons/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/icons/tick.png -------------------------------------------------------------------------------- /content/materials/lambda/logo_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/logo_512.png -------------------------------------------------------------------------------- /content/materials/lambda/ring1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/ring1.png -------------------------------------------------------------------------------- /content/materials/lambda/ring2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/ring2.png -------------------------------------------------------------------------------- /content/materials/lambda/ring3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/ring3.png -------------------------------------------------------------------------------- /content/materials/lambda/run_point.vmt: -------------------------------------------------------------------------------- 1 | "MonitorScreen" 2 | { 3 | "$basetexture" "lambda/run_point" 4 | "$translucent" "1" 5 | "$saturation" "0" 6 | "$contrast" "1" 7 | "$tint" "[1 1 1]" 8 | "$ignorez" "0" 9 | "$nocull" "1" 10 | } 11 | -------------------------------------------------------------------------------- /content/materials/lambda/run_point.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/run_point.vtf -------------------------------------------------------------------------------- /content/materials/lambda/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/success.png -------------------------------------------------------------------------------- /content/materials/lambda/uiskin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/uiskin.png -------------------------------------------------------------------------------- /content/materials/lambda/vehicle.vmt: -------------------------------------------------------------------------------- 1 | "MonitorScreen" 2 | { 3 | "$basetexture" "lambda/vehicle" 4 | "$translucent" "1" 5 | "$saturation" "0" 6 | "$contrast" "1" 7 | "$tint" "[1 1 1]" 8 | "$ignorez" "1" 9 | } 10 | -------------------------------------------------------------------------------- /content/materials/lambda/vehicle.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/lambda/vehicle.vtf -------------------------------------------------------------------------------- /content/materials/models/decay/cockroach/roach.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | "$baseTexture" "models/decay/cockroach/roach" 4 | } -------------------------------------------------------------------------------- /content/materials/models/decay/cockroach/roach.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/content/materials/models/decay/cockroach/roach.vtf -------------------------------------------------------------------------------- /content/materials/nature/toxicslime002a.vmt: -------------------------------------------------------------------------------- 1 | // envmaptint_fix 2 | "LightmappedGeneric" 3 | { 4 | "LightmappedGeneric_DX6" 5 | { 6 | "$fallbackmaterial" "nature/toxicslime002a_dx70" 7 | } 8 | 9 | "$envmap" "env_cubemap" 10 | "$envmaptint" "[ 1.00 .89 .80 ]" 11 | "$envmapcontrast" "1" 12 | 13 | "$surfaceprop" "slime" 14 | "%keywords" "wasteland" 15 | "%compileSlime" 1 16 | 17 | "$bottommaterial" "nature/toxicslime002a_beneath" 18 | 19 | "$fogenable" 1 20 | "$fogcolor" "{29 199 39}" 21 | "$fogstart" 1.00 22 | "$fogend" 330.00 23 | 24 | $color "[0.9 2.2 0.5]" 25 | $selfillum 1 26 | 27 | // Use scrolling animated textures on DX9 hardware 28 | ">=DX90" 29 | { 30 | "$basetexture" "Nature/toxicslime002a" 31 | "$bumpmap" "dev/waterA_normal" // These two slide... 32 | "$bumpmap2" "dev/waterB_normal" // ...against each other 33 | 34 | "$bumpmask" "Nature/toxicslime002a_normal" // This holds still and alpha masks to get final normal 35 | 36 | "Proxies" 37 | { 38 | "TextureScroll" 39 | { 40 | "texturescrollvar" "$bumptransform" 41 | "texturescrollrate" 0.03 42 | "texturescrollangle" 100.00 43 | "texturescale" 2.8 44 | } 45 | "TextureScroll" 46 | { 47 | "texturescrollvar" "$bumptransform2" 48 | "texturescrollrate" 0.03 49 | "texturescrollangle" -36.00 50 | "texturescale" 3.4 51 | } 52 | } 53 | } 54 | 55 | // Use animated texture on Pre DX9 hardware 56 | " CurTime() then return false end 31 | 32 | return true 33 | end 34 | 35 | function ENT:OnSpawnedNPC(ent) 36 | if self.RenameNPC ~= nil and self.RenameNPC ~= "" then 37 | ent:SetName(self.RenameNPC) 38 | end 39 | 40 | self:FireOutputs("OnSpawnNPC", ent, self) 41 | self.TimeNextAvailable = CurTime() + self.ReuseDelay 42 | end 43 | end -------------------------------------------------------------------------------- /entities/entities/lambda_client_sound.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | ENT.Base = "lambda_entity" 6 | ENT.Type = "point" 7 | DEFINE_BASECLASS("lambda_entity") 8 | local MSG_PLAY_SOUND = 1 9 | local MSG_STOP_SOUND = 2 10 | 11 | if SERVER then 12 | util.AddNetworkString("lambda_client_sound_msg") 13 | end 14 | 15 | function ENT:PreInitialize() 16 | BaseClass.PreInitialize(self) 17 | self:SetInputFunction("PlaySound", self.InputPlaySound) 18 | self:SetInputFunction("StopSound", self.InputStopSound) 19 | 20 | self:SetupNWVar("Sound", "string", { 21 | Default = "", 22 | KeyValue = "sound" 23 | }) 24 | 25 | self:SetupNWVar("Pitch", "float", { 26 | Default = 100, 27 | KeyValue = "pitch" 28 | }) 29 | end 30 | 31 | function ENT:Initialize() 32 | BaseClass.Initialize(self) 33 | end 34 | 35 | function ENT:KeyValue(key, val) 36 | BaseClass.KeyValue(self, key, val) 37 | end 38 | 39 | function ENT:UpdateTransmitState() 40 | return TRANSMIT_ALWAYS 41 | end 42 | 43 | function ENT:InputPlaySound(data, activator, caller) 44 | if IsValid(activator) and activator:IsPlayer() then 45 | net.Start("lambda_client_sound_msg") 46 | net.WriteInt(MSG_PLAY_SOUND, 3) 47 | net.WriteEntity(self) 48 | net.WriteEntity(activator) 49 | net.Send(activator) 50 | end 51 | end 52 | 53 | function ENT:InputStopSound(data, activator, caller) 54 | if IsValid(activator) and activator:IsPlayer() then 55 | net.Start("lambda_client_sound_msg") 56 | net.WriteInt(MSG_STOP_SOUND, 3) 57 | net.WriteEntity(self) 58 | net.WriteEntity(activator) 59 | net.Send(activator) 60 | end 61 | end 62 | 63 | if CLIENT then 64 | function ENT:PlaySoundClient(activator) 65 | if not IsValid(activator) then return end 66 | local soundFile = self:GetNWVar("Sound", "") 67 | if soundFile == "" then return end 68 | local sndProps = sound.GetProperties(soundFile) 69 | if sndProps == nil then return end 70 | activator:EmitSound(soundFile, sndProps.level, sndProps.pitch, sndProps.volume, sndProps.channel) 71 | end 72 | 73 | function ENT:StopSoundClient(activator) 74 | if not IsValid(activator) then return end 75 | local soundFile = self:GetNWVar("Sound", "") 76 | if soundFile == "" then return end 77 | activator:StopSound(soundFile) 78 | end 79 | 80 | net.Receive("lambda_client_sound_msg", function() 81 | local msgType = net.ReadInt(3) 82 | local ent = net.ReadEntity() 83 | local activator = net.ReadEntity() 84 | 85 | if IsValid(ent) then 86 | if msgType == MSG_PLAY_SOUND then 87 | ent:PlaySoundClient(activator) 88 | elseif msgType == MSG_STOP_SOUND then 89 | ent:StopSoundClient(activator) 90 | end 91 | end 92 | end) 93 | end -------------------------------------------------------------------------------- /entities/entities/lambda_clientcommand.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | ENT.Base = "lambda_entity" 3 | ENT.Type = "point" 4 | DEFINE_BASECLASS("lambda_entity") 5 | 6 | function ENT:PreInitialize() 7 | BaseClass.PreInitialize(self) 8 | self:SetInputFunction("Command", self.InputCommand) 9 | end 10 | 11 | function ENT:Initialize() 12 | BaseClass.Initialize(self) 13 | end 14 | 15 | function ENT:KeyValue(key, val) 16 | BaseClass.KeyValue(self, key, val) 17 | end 18 | 19 | function ENT:InputCommand(data, activator, caller) 20 | DbgPrint("Command: " .. data .. ", " .. tostring(activator) .. ", " .. tostring(caller)) 21 | 22 | return self:Command(data, activator, caller) 23 | end 24 | 25 | function ENT:Command(data, activator, caller) 26 | -- Stub 27 | end 28 | end -------------------------------------------------------------------------------- /entities/entities/lambda_lua_logic.lua: -------------------------------------------------------------------------------- 1 | local DbgPrint = GetLogging("LuaLogic") 2 | ENT.Base = "lambda_entity" 3 | ENT.Type = "point" 4 | DEFINE_BASECLASS("lambda_entity") 5 | 6 | function ENT:PreInitialize() 7 | BaseClass.PreInitialize(self) 8 | DbgPrint(self, "PreInitialize") 9 | self:SetInputFunction("RunLua", self.InputRunLua) 10 | end 11 | 12 | function ENT:Initialize() 13 | BaseClass.Initialize(self) 14 | DbgPrint(self, "Initialize") 15 | end 16 | 17 | function ENT:InputRunLua(data, activator, caller) 18 | if self.OnRunLua ~= nil then 19 | self:OnRunLua(data, activator, caller) 20 | else 21 | DbgPrint(self, "No OnRunLua function defined.") 22 | end 23 | end 24 | 25 | function ENT:OnRunLua(data, activator, caller) 26 | -- Override this function. 27 | end 28 | 29 | function ENT:UpdateTransmitState() 30 | return TRANSMIT_NEVER 31 | end -------------------------------------------------------------------------------- /entities/entities/lambda_npc_interactions.lua: -------------------------------------------------------------------------------- 1 | local CurTime = CurTime 2 | local util = util 3 | local IsValid = IsValid 4 | ENT.Base = "lambda_entity" 5 | ENT.Type = "point" 6 | DEFINE_BASECLASS("lambda_entity") 7 | 8 | function ENT:PreInitialize() 9 | BaseClass.PreInitialize(self) 10 | DbgPrint(self, "PreInitialize") 11 | end 12 | 13 | function ENT:Initialize() 14 | BaseClass.Initialize(self) 15 | DbgPrint(self, "Initialize") 16 | end 17 | 18 | local COND_SEE_PLAYER = 32 19 | 20 | function ENT:LinkNPC(npc) 21 | self:SetPos(npc:GetPos()) 22 | self:SetOwner(npc) 23 | self:SetParent(npc) 24 | 25 | npc:CallOnRemove("LambdaNPCInteractor", function() 26 | self:Remove() 27 | end) 28 | end 29 | 30 | function ENT:SearchForInteractTargets() 31 | local owner = self:GetOwner() 32 | if not IsValid(owner) then return end 33 | local visible = {} 34 | 35 | for _, v in pairs(util.GetAllPlayers()) do 36 | if v:Alive() == false then continue end 37 | 38 | if owner:Visible(v) then 39 | table.insert(visible, v) 40 | end 41 | end 42 | 43 | if #visible == 0 then 44 | owner:ClearCondition(COND_SEE_PLAYER) 45 | 46 | return 47 | else 48 | owner:SetCondition(COND_SEE_PLAYER) 49 | end 50 | 51 | for _, v in pairs(visible) do 52 | local wep = v:GetActiveWeapon() 53 | if IsValid(wep) == false or wep:GetClass() ~= "weapon_physcannon" then continue end 54 | local heldObject = wep:GetAttachedObject() 55 | 56 | if IsValid(heldObject) then 57 | owner:SetSaveValue("m_hHackTarget", heldObject) 58 | end 59 | end 60 | end 61 | 62 | function ENT:Think() 63 | self:NextThink(CurTime() + 1) 64 | self:SearchForInteractTargets() 65 | 66 | return true 67 | end 68 | 69 | function ENT:UpdateTransmitState() 70 | return TRANSMIT_NEVER 71 | end -------------------------------------------------------------------------------- /entities/entities/lambda_path_tracker.lua: -------------------------------------------------------------------------------- 1 | local DbgPrint = GetLogging("PathTracker") 2 | ENT.Base = "lambda_entity" 3 | ENT.Type = "point" 4 | DEFINE_BASECLASS("lambda_entity") 5 | 6 | function ENT:PreInitialize() 7 | BaseClass.PreInitialize(self) 8 | DbgPrint(self, "PreInitialize") 9 | self:SetInputFunction("OnPass", self.OnPass) 10 | end 11 | 12 | function ENT:Initialize() 13 | BaseClass.Initialize(self) 14 | DbgPrint(self, "Initialize") 15 | end 16 | 17 | -- HACKHACK: Since we can't call CBaseEntity::OnRestore we have to manually 18 | -- set the next track target. 19 | function ENT:OnPass(data, activator, caller) 20 | local nextTarget = caller:GetInternalVariable("target") 21 | DbgPrint(self, "Passed : " .. tostring(activator), caller, nextTarget) 22 | activator:SetSaveValue("target", nextTarget) 23 | activator:SetKeyValue("target", nextTarget) 24 | end 25 | 26 | function ENT:UpdateTransmitState() 27 | return TRANSMIT_NEVER 28 | end -------------------------------------------------------------------------------- /entities/entities/logic_auto.lua: -------------------------------------------------------------------------------- 1 | --local DbgPrint = print 2 | local DbgPrint = GetLogging("LogicAuto") 3 | -- Spawnflags. 4 | local SF_AUTO_FIREONCE = 0x0001 5 | ENT.Base = "lambda_entity" 6 | ENT.Type = "point" 7 | DEFINE_BASECLASS("lambda_entity") 8 | 9 | function ENT:PreInitialize() 10 | BaseClass.PreInitialize(self) 11 | DbgPrint(self, "PreInitialize") 12 | self:SetupOutput("OnMapSpawn") 13 | self:SetupOutput("OnNewGame") 14 | self:SetupOutput("OnLoadGame") 15 | self:SetupOutput("OnMapTransition") 16 | self:SetupOutput("OnBackgroundMap") 17 | self:SetupOutput("OnMultiNewMap") 18 | self:SetupOutput("OnMultiNewRound") 19 | self:SetInputFunction("Enable", self.Enable) 20 | self:SetInputFunction("Disable", self.Disable) 21 | 22 | self:SetupNWVar("Disabled", "bool", { 23 | Default = true, 24 | KeyValue = "StartDisabled" 25 | }) 26 | 27 | self:SetupNWVar("GlobalState", "string", { 28 | Default = "", 29 | KeyValue = "globalstate" 30 | }) 31 | end 32 | 33 | function ENT:Initialize() 34 | BaseClass.Initialize(self) 35 | DbgPrint(self, "Initialize") 36 | self:NextThink(CurTime() + 0.2) 37 | end 38 | 39 | function ENT:Think() 40 | if self:GetNWVar("Disabled") == true then 41 | self:NextThink(CurTime() + 1) 42 | 43 | return true 44 | end 45 | 46 | self:NextThink(CurTime() + 0.2) 47 | local globalState = self:GetNWVar("GlobalState") 48 | if globalState ~= "" and game.GetGlobalState(globalState) ~= GLOBAL_ON then return true end 49 | local loadType = "" 50 | 51 | if GAMEMODE ~= nil then 52 | loadType = GAMEMODE:GetMapLoadType() 53 | else 54 | loadType = game.MapLoadType() 55 | end 56 | 57 | if loadType == "transition" then 58 | self:FireOutputs("OnMapTransition", nil, nil) 59 | elseif loadType == "newgame" then 60 | self:FireOutputs("OnNewGame", nil, nil) 61 | elseif loadType == "loadgame" then 62 | self:FireOutputs("OnLoadGame", nil, nil) 63 | elseif loadType == "background" then 64 | self:FireOutputs("OnBackgroundMap", nil, nil) 65 | end 66 | 67 | -- Fires without condition. 68 | self:FireOutputs("OnMapSpawn", nil, nil) 69 | 70 | if self:HasSpawnFlags(SF_AUTO_FIREONCE) == true then 71 | self.Think = function() end 72 | self:Remove() 73 | else 74 | -- Stay dormant, for whatever reason. 75 | self:Disable() 76 | end 77 | 78 | return true 79 | end 80 | 81 | function ENT:Enable() 82 | self:SetNWVar("Disabled", false) 83 | self:NextThink(CurTime()) 84 | return true 85 | end 86 | 87 | function ENT:Disable() 88 | self:SetNWVar("Disabled", true) 89 | return true 90 | end 91 | 92 | function ENT:UpdateTransmitState() 93 | return TRANSMIT_NEVER 94 | end -------------------------------------------------------------------------------- /entities/entities/player_loadsaved.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | ENT.Base = "lambda_entity" 3 | ENT.Type = "point" 4 | DEFINE_BASECLASS("lambda_entity") 5 | 6 | function ENT:PreInitialize() 7 | BaseClass.PreInitialize(self) 8 | self:SetInputFunction("Reload", self.InputReload) 9 | self:SetInputFunction("RestartRound", self.InputRestartRound) 10 | end 11 | 12 | function ENT:Initialize() 13 | BaseClass.Initialize(self) 14 | end 15 | 16 | function ENT:KeyValue(key, val) 17 | BaseClass.KeyValue(self, key, val) 18 | end 19 | 20 | function ENT:InputReload(data, activator, caller) 21 | --GAMEMODE:RestartRound() 22 | return true 23 | end 24 | 25 | function ENT:InputRestartRound(data, activator, caller) 26 | GAMEMODE:RestartRound(data) 27 | 28 | return true 29 | end 30 | 31 | function ENT:UpdateTransmitState() 32 | return TRANSMIT_NEVER 33 | end 34 | end -------------------------------------------------------------------------------- /entities/entities/player_speedmod.lua: -------------------------------------------------------------------------------- 1 | --https://developer.valvesoftware.com/wiki/Player_speedmod 2 | local DbgPrint = GetLogging("Trigger") 3 | ENT.Base = "base_point" 4 | ENT.Type = "point" 5 | 6 | function ENT:Initialize() 7 | DbgPrint("player_speedmod:Initialize") 8 | end 9 | 10 | function ENT:AcceptInput(inputName, activator, called, data) 11 | DbgPrint("player_speedmod:AcceptInput(" .. tostring(inputName) .. ", " .. tostring(activator) .. ", " .. tostring(called) .. ", " .. tostring(data) .. ")") 12 | 13 | if inputName == "ModifySpeed" then 14 | local speed = tonumber(data) 15 | 16 | for _, v in pairs(util.GetAllPlayers()) do 17 | if v:FlashlightIsOn() then 18 | v:Flashlight(false) 19 | end 20 | v:SetLaggedMovementValue(speed) 21 | end 22 | 23 | return true 24 | else 25 | DbgPrint("Unhandled input: " .. tostring(inputName)) 26 | end 27 | 28 | return false 29 | end -------------------------------------------------------------------------------- /entities/entities/point_teleport.lua: -------------------------------------------------------------------------------- 1 | --local DbgPrint = print 2 | -- REFACTOR ME: lambad_entity as base 3 | local DbgPrint = GetLogging("Trigger") 4 | local util = util 5 | local ents = ents 6 | local player = player 7 | ENT.Base = "base_point" 8 | ENT.Type = "point" 9 | SF_TELEPORT_LAMBDA_CHECKPOINT = 8192 10 | 11 | function ENT:Initialize() 12 | DbgPrint("point_teleport:Initialize") 13 | self.Target = self.Target or "" 14 | self.StackMode = self.StackMode or false 15 | self.StackDir = self.StackDir or self:GetAngles():Forward() 16 | self.StackLength = self.StackLength or 100 17 | end 18 | 19 | function ENT:AcceptInput(inputName, activator, called, data) 20 | DbgPrint("point_teleport:AcceptInput(" .. tostring(inputName) .. ", " .. tostring(activator) .. ", " .. tostring(called) .. ", " .. tostring(data) .. ")") 21 | 22 | if inputName == "Teleport" then 23 | -- We gonna teleport all players, kinda nasty work-around to replicate this entity type. 24 | if self.Target == "!player" or self.Target == "!players" then 25 | local pos = self:GetPos() 26 | local ang = self:GetAngles() 27 | 28 | for _, v in pairs(player.GetAll()) do 29 | DbgPrint("[" .. self:GetName() .. "] Teleporting player " .. tostring(v) .. "to pos: " .. tostring(pos) .. ", ang: " .. tostring(ang)) 30 | v:TeleportPlayer(pos, ang) 31 | end 32 | 33 | if self:HasSpawnFlags(SF_TELEPORT_LAMBDA_CHECKPOINT) == true then 34 | GAMEMODE:SetPlayerCheckpoint({ 35 | Pos = pos, 36 | Ang = ang 37 | }) 38 | end 39 | 40 | return true 41 | else 42 | -- We have to find them. 43 | local entryPos = self:GetPos() 44 | local teleportPos = entryPos 45 | 46 | for _, v in pairs(ents.FindByName(self.Target)) do 47 | DbgPrint("Teleporting target: " .. self.Target .. " to: " .. tostring(teleportPos)) 48 | v:SetPos(teleportPos) 49 | v:SetAngles(self:GetAngles()) 50 | 51 | if self.StackMode == true then 52 | DbgPrint("Using stack mode teleportation") 53 | teleportPos = teleportPos + (self.StackDir * self.StackLength) 54 | end 55 | end 56 | 57 | return true 58 | end 59 | else 60 | DbgPrint("Unhandled input: " .. tostring(inputName)) 61 | end 62 | --return false 63 | end 64 | 65 | function ENT:KeyValue(key, value) 66 | DbgPrint("point_teleport:KeyValue(" .. key .. ", " .. value .. ")") 67 | 68 | if key == "target" then 69 | self.Target = value 70 | elseif key == "stackmode" then 71 | self.StackMode = tobool(value) 72 | elseif key == "stackdir" then 73 | self.StackDir = util.StringToType(value, "Vector") 74 | elseif key == "stacklength" then 75 | self.StackLength = tonumber(value) 76 | end 77 | end 78 | 79 | function ENT:Think() 80 | end 81 | 82 | function ENT:OnRemove() 83 | end -------------------------------------------------------------------------------- /entities/entities/trigger_auto.lua: -------------------------------------------------------------------------------- 1 | --local DbgPrint = print 2 | -- REFACTOR ME: lambad_entity as base 3 | local DbgPrint = GetLogging("TriggerAuto") 4 | -- Spawnflags. 5 | SF_AUTO_FIREONCE = 0x0001 6 | ENT.Base = "lambda_entity" 7 | ENT.Type = "point" 8 | DEFINE_BASECLASS("lambda_entity") 9 | 10 | function ENT:PreInitialize() 11 | BaseClass.PreInitialize(self) 12 | DbgPrint(self, "PreInitialize") 13 | self:SetupOutput("OnTrigger") 14 | end 15 | 16 | function ENT:Initialize() 17 | BaseClass.Initialize(self) 18 | DbgPrint(self, "Initialize") 19 | self.Disabled = true 20 | end 21 | 22 | function ENT:AcceptInput(inputName, activator, called, data) 23 | if inputName:iequals("enable") then 24 | DbgPrint(self, "Enabled") 25 | self.Disabled = false 26 | 27 | return true 28 | elseif inputName:iequals("disable") then 29 | DbgPrint(self, "Disabled") 30 | self.Disabled = true 31 | 32 | return true 33 | end 34 | 35 | return BaseClass.AcceptInput(self, inputName, activator, called, data) 36 | end 37 | 38 | function ENT:Think() 39 | if self.Disabled == true then return end 40 | 41 | if self.GlobalState == nil or game.GetGlobalState(self.GlobalState) == GLOBAL_ON then 42 | DbgPrint(self, "Firing OnTrigger") 43 | self:FireOutputs("OnTrigger", nil, self) 44 | 45 | if self:HasSpawnFlags(SF_AUTO_FIREONCE) then 46 | self.Disabled = true 47 | self:Remove() 48 | end 49 | 50 | -- Only do it once. 51 | self.Disabled = true 52 | end 53 | end 54 | 55 | function ENT:KeyValue(key, val) 56 | BaseClass.KeyValue(self, key, val) 57 | DbgPrint(self, "KeyValue(" .. key .. ", " .. val .. ")") 58 | 59 | if key:iequals("globalstate") then 60 | self.GlobalState = val 61 | end 62 | end 63 | 64 | function ENT:OnRemove() 65 | end 66 | 67 | function ENT:UpdateTransmitState() 68 | return TRANSMIT_NEVER 69 | end -------------------------------------------------------------------------------- /entities/entities/trigger_multiple.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | ENT.Base = "lambda_trigger" 3 | ENT.Type = "brush" 4 | DEFINE_BASECLASS("lambda_trigger") 5 | 6 | function ENT:PreInitialize() 7 | BaseClass.PreInitialize(self) 8 | BaseClass.SetWaitTime(self, 0.2) 9 | end 10 | end -------------------------------------------------------------------------------- /entities/entities/trigger_once.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | ENT.Base = "lambda_trigger" 3 | ENT.Type = "brush" 4 | DEFINE_BASECLASS("lambda_trigger") 5 | 6 | function ENT:PreInitialize() 7 | BaseClass.PreInitialize(self) 8 | BaseClass.SetWaitTime(self, -1) -- Remove once triggered. 9 | end 10 | end -------------------------------------------------------------------------------- /entities/entities/trigger_transition.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | ENT.Base = "lambda_trigger" 3 | ENT.Type = "brush" 4 | DEFINE_BASECLASS("lambda_trigger") 5 | 6 | function ENT:Initialize() 7 | --DbgPrint(self, "trigger_once:Initialize") 8 | BaseClass.Initialize(self) 9 | BaseClass.SetWaitTime(self, 0) -- Never remove. 10 | self:AddSolidFlags(FSOLID_TRIGGER_TOUCH_DEBRIS) 11 | end 12 | 13 | function ENT:PassesTriggerFilters(ent) 14 | -- Anything goes in here. 15 | return true 16 | end 17 | 18 | function ENT:StartTouch(ent) 19 | --DbgPrint(self, "StartTouch(" .. tostring(ent) .. ")") 20 | return BaseClass.StartTouch(self, ent) 21 | end 22 | 23 | function ENT:Touch(ent) 24 | --DbgPrint(self, "Touch(" .. tostring(ent) .. ")") 25 | return BaseClass.Touch(self, ent) 26 | end 27 | 28 | function ENT:GetTouching() 29 | local trList = {} 30 | 31 | util.TraceEntity({ 32 | start = self:GetPos(), 33 | endpos = self:GetPos(), 34 | mask = MASK_ALL, 35 | ignoreworld = true, 36 | filter = function(ent) 37 | table.insert(trList, ent) 38 | 39 | return false 40 | end 41 | }, self) 42 | 43 | return trList 44 | end 45 | end -------------------------------------------------------------------------------- /gamemode/cl_lang.lua: -------------------------------------------------------------------------------- 1 | local DbgPrint = GetLogging("Language") 2 | 3 | local SUPPORTED_LANGUAGES = { 4 | ["en"] = "english", 5 | } 6 | 7 | local function GetCurrentLanguage() 8 | local gmod_language = GetConVar("gmod_language") 9 | local lang = gmod_language:GetString() 10 | local realLang = SUPPORTED_LANGUAGES[lang] 11 | if realLang == nil then 12 | DbgPrint("Language '" .. lang .. "' is not supported, falling back to 'en'") 13 | realLang = "english" 14 | end 15 | return realLang 16 | end 17 | 18 | function GM:LoadLocalisation() 19 | local langName = GetCurrentLanguage() 20 | local gameType = self:GetGameType() 21 | if gameType == nil then return end 22 | while gameType ~= nil do 23 | local langData = gameType.Localisation 24 | if langData ~= nil then 25 | local langEntries = langData[langName] 26 | if langEntries ~= nil then 27 | for k, v in pairs(langEntries) do 28 | DbgPrint("Adding localisation: " .. k .. " = " .. v) 29 | language.Add(k, v) 30 | end 31 | end 32 | end 33 | gameType = gameType.Base 34 | end 35 | end 36 | 37 | cvars.AddChangeCallback("gmod_language", function(cvar, old, new) 38 | GAMEMODE:LoadLocalisation() 39 | end) -------------------------------------------------------------------------------- /gamemode/cl_ragdoll_ext.lua: -------------------------------------------------------------------------------- 1 | --local DbgPrint = GetLogging("Ragdoll") 2 | local CurTime = CurTime 3 | local Vector = Vector 4 | local util = util 5 | local table = table 6 | 7 | local ImpactSounds = { 8 | Soft = {"physics/body/body_medium_impact_soft1.wav", "physics/body/body_medium_impact_soft2.wav", "physics/body/body_medium_impact_soft3.wav", "physics/body/body_medium_impact_soft4.wav", "physics/body/body_medium_impact_soft5.wav", "physics/body/body_medium_impact_soft6.wav", "physics/body/body_medium_impact_soft7.wav"}, 9 | Hard = {"physics/body/body_medium_impact_hard1.wav", "physics/body/body_medium_impact_hard2.wav", "physics/body/body_medium_impact_hard3.wav", "physics/body/body_medium_impact_hard4.wav", "physics/body/body_medium_impact_hard5.wav", "physics/body/body_medium_impact_hard6.wav"}, 10 | Break = {"physics/body/body_medium_break2.wav", "physics/body/body_medium_break3.wav", "physics/body/body_medium_break4.wav"} 11 | } 12 | 13 | local bloodEmitter = nil 14 | 15 | local function HandleRagdollImpact(ent, data) 16 | if ent:IsEffectActive(EF_NODRAW) then return end -- Do nothing if we are invisible. 17 | ent.LastRagdollImpact = ent.LastRagdollImpact or 0 18 | 19 | if bloodEmitter == nil then 20 | bloodEmitter = ParticleEmitter(Vector(0, 0, 0), false) 21 | end 22 | 23 | if CurTime() - ent.LastRagdollImpact > 0.05 then 24 | ent.LastRagdollImpact = CurTime() 25 | --PrintTable(data) 26 | local sndTable = nil 27 | 28 | if data.Speed >= 600 then 29 | sndTable = ImpactSounds.Break 30 | elseif data.Speed >= 300 then 31 | sndTable = ImpactSounds.Hard 32 | elseif data.Speed >= 100 then 33 | sndTable = ImpactSounds.Soft 34 | end 35 | 36 | if sndTable then 37 | local snd = table.Random(sndTable) 38 | ent:EmitSound(snd) 39 | end 40 | 41 | if data.Speed >= 130 then 42 | local effectdata = EffectData() 43 | effectdata:SetNormal(data.HitNormal) 44 | effectdata:SetOrigin(data.HitPos) 45 | effectdata:SetMagnitude(3) 46 | effectdata:SetScale(10) 47 | effectdata:SetFlags(3) 48 | effectdata:SetColor(0) 49 | util.Effect("bloodspray", effectdata, true, true) 50 | effectdata = EffectData() 51 | effectdata:SetNormal(data.HitNormal) 52 | effectdata:SetOrigin(data.HitPos) 53 | effectdata:SetMagnitude(data.Speed / 100) 54 | effectdata:SetScale(10) 55 | effectdata:SetFlags(3) 56 | effectdata:SetColor(0) 57 | util.Effect("BloodImpact", effectdata, true, true) 58 | util.Decal("Blood", data.HitPos + data.HitNormal, data.HitPos - data.HitNormal) 59 | end 60 | end 61 | end 62 | 63 | function GM:HandleRagdollCreation(ragdoll) 64 | ragdoll:AddCallback("PhysicsCollide", HandleRagdollImpact) 65 | end -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/cl_localisation.lua: -------------------------------------------------------------------------------- 1 | if SERVER then AddCSLuaFile() end 2 | local LOCALISATION = {} 3 | LOCALISATION["english"] = {} 4 | return LOCALISATION -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c0a0.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("MapScript") 6 | local MAPSCRIPT = {} 7 | MAPSCRIPT.PlayersLocked = false 8 | 9 | MAPSCRIPT.DefaultLoadout = { 10 | Weapons = {}, 11 | Ammo = {}, 12 | Armor = 0, 13 | HEV = false 14 | } 15 | 16 | MAPSCRIPT.InputFilters = {} 17 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 18 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 19 | 20 | function MAPSCRIPT:Init() 21 | end 22 | 23 | function MAPSCRIPT:LevelPostInit() 24 | DbgPrint("LevelPostInit") 25 | 26 | for k, v in pairs(ents.FindByClass("info_player_start")) do 27 | v:Remove() 28 | end 29 | 30 | ents.WaitForEntityByName("train", function(ent) 31 | DbgPrint("Fixing spawn position") 32 | ent:Fire("Stop") 33 | local pos = ent:LocalToWorld(Vector(50, 40, 8)) 34 | local ang = ent:LocalToWorldAngles(Angle(0, 0, 0)) 35 | local playerStart = ents.Create("info_player_start") 36 | playerStart:SetPos(pos) 37 | playerStart:SetAngles(ang) 38 | playerStart:Spawn() 39 | playerStart.MasterSpawn = true 40 | playerStart:SetParent(ent) 41 | end) 42 | end 43 | 44 | function MAPSCRIPT:PostInit() 45 | end 46 | 47 | function MAPSCRIPT:PostPlayerSpawn(ply) 48 | -- Failsafe: Make sure players are in the train 49 | ents.WaitForEntityByName("train", function(ent) 50 | local pos = ent:LocalToWorld(Vector(50, 40, 8)) 51 | local ang = ent:LocalToWorldAngles(Angle(0, 0, 0)) 52 | ply:TeleportPlayer(pos, ang) 53 | end) 54 | end 55 | 56 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c0a0a.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = false 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | end 21 | 22 | function MAPSCRIPT:PostInit() 23 | end 24 | 25 | function MAPSCRIPT:PostPlayerSpawn(ply) 26 | -- Failsafe: Make sure players are in the train 27 | ents.WaitForEntityByName("train", function(ent) 28 | local pos = ent:LocalToWorld(Vector(50, 40, 8)) 29 | local ang = ent:LocalToWorldAngles(Angle(0, 0, 0)) 30 | ply:TeleportPlayer(pos, ang) 31 | end) 32 | end 33 | 34 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c0a0b.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = false 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | end 21 | 22 | function MAPSCRIPT:PostInit() 23 | if SERVER then 24 | ents.WaitForEntityByName("goingdown", function(ent) 25 | ent:Spawn() 26 | end) 27 | 28 | GAMEMODE:WaitForInput("upper1", "InPass", function(ent) 29 | local goingdown = ents.FindFirstByName("goingdown") 30 | local train = ents.FindFirstByName("train") 31 | 32 | util.RunDelayed(function() 33 | if not IsValid(goingdown) or not IsValid(train) then return end 34 | goingdown:Input("Trigger", train, train) 35 | print("Forcing down", train) 36 | end, CurTime() + 2) 37 | end) 38 | end 39 | end 40 | 41 | function MAPSCRIPT:PostPlayerSpawn(ply) 42 | -- Failsafe: Make sure players are in the train 43 | ents.WaitForEntityByName("train", function(ent) 44 | local pos = ent:LocalToWorld(Vector(50, 40, 8)) 45 | local ang = ent:LocalToWorldAngles(Angle(0, 0, 0)) 46 | ply:TeleportPlayer(pos, ang) 47 | end) 48 | end 49 | 50 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c0a0c.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = false 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | end 21 | 22 | function MAPSCRIPT:PostInit() 23 | end 24 | 25 | function MAPSCRIPT:PostPlayerSpawn(ply) 26 | -- Failsafe: Make sure players are in the train 27 | ents.WaitForEntityByName("train", function(ent) 28 | local pos = ent:LocalToWorld(Vector(50, 40, 8)) 29 | local ang = ent:LocalToWorldAngles(Angle(0, 0, 0)) 30 | ply:TeleportPlayer(pos, ang) 31 | end) 32 | end 33 | 34 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c0a0d.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = false 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | end 21 | 22 | function MAPSCRIPT:PostInit() 23 | if SERVER then 24 | ents.WaitForEntityByName("goingdown", function(ent) 25 | ent:Spawn() 26 | end) 27 | 28 | GAMEMODE:WaitForInput("lower88", "InPass", function(ent) 29 | local goingdown = ents.FindFirstByName("goingdown") 30 | local train = ents.FindFirstByName("train") 31 | 32 | util.RunDelayed(function() 33 | if not IsValid(goingdown) or not IsValid(train) then return end 34 | goingdown:Input("Trigger", train, train) 35 | print("Forcing down", train) 36 | end, CurTime() + 2) 37 | end) 38 | end 39 | end 40 | 41 | function MAPSCRIPT:PostPlayerSpawn(ply) 42 | -- Failsafe: Make sure players are in the train 43 | ents.WaitForEntityByName("train", function(ent) 44 | local pos = ent:LocalToWorld(Vector(50, 40, 8)) 45 | local ang = ent:LocalToWorldAngles(Angle(0, 0, 0)) 46 | ply:TeleportPlayer(pos, ang) 47 | end) 48 | end 49 | 50 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c0a0e.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = false 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | 18 | MAPSCRIPT.EntityFilterByName = { 19 | ["changetoc1a0mm"] = true 20 | } 21 | 22 | function MAPSCRIPT:Init() 23 | end 24 | 25 | function MAPSCRIPT:PostInit() 26 | if SERVER then 27 | -- Block. 28 | local blockade = ents.Create("func_brush") 29 | blockade:SetPos(Vector(-2120, -594.165466, -200)) 30 | blockade:SetModel("*15") 31 | blockade:SetKeyValue("spawnflags", "2") 32 | blockade:SetKeyValue("Solidity", "0") 33 | blockade:SetKeyValue("solidbsp", "0") 34 | blockade:SetKeyValue("StartDisabled", "1") 35 | blockade:Spawn() 36 | blockade:SetName("lambda_pclip1") 37 | local doorTrigger = ents.Create("trigger_once") 38 | doorTrigger:Fire("AddOutput", "OnTrigger lambda_pclip1,Enable,,0,-1") 39 | doorTrigger:Fire("AddOutput", "OnTrigger doors,Toggle,,0,-1") 40 | doorTrigger:SetKeyValue("teamwait", "1") 41 | doorTrigger:SetupTrigger(Vector(-2405.352295, -588.131409, -252.968750), Angle(0, 0, 0), Vector(-180, -80, 0), Vector(200, 80, 120)) 42 | -- Lazy valve, make sure he exists. 43 | local barney = ents.FindFirstByName("barney1") 44 | 45 | if not IsValid(barney) then 46 | barney = ents.Create("monster_barney") 47 | barney:SetName("barney1") 48 | barney:SetPos(Vector(-2008.000000, -472.000000, -252.968750)) 49 | barney:SetAngles(Angle(0, 320, 0)) 50 | barney:SetModel("models/hl1bar.mdl") 51 | barney:Spawn() 52 | end 53 | end 54 | end 55 | 56 | function MAPSCRIPT:PostPlayerSpawn(ply) 57 | --DbgPrint("PostPlayerSpawn") 58 | end 59 | 60 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c1a0.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = false 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | --TEST_DbgPrint("-- Mapscript: Template loaded --") 21 | end 22 | 23 | function MAPSCRIPT:PostInit() 24 | end 25 | 26 | function MAPSCRIPT:PostPlayerSpawn(ply) 27 | ----TEST_DbgPrint("PostPlayerSpawn") 28 | end 29 | 30 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c1a0a.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = true 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | --TEST_DbgPrint("-- Mapscript: Template loaded --") 21 | end 22 | 23 | function MAPSCRIPT:PostInit() 24 | end 25 | 26 | function MAPSCRIPT:PostPlayerSpawn(ply) 27 | ----TEST_DbgPrint("PostPlayerSpawn") 28 | end 29 | 30 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c1a0b.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = true 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | --TEST_DbgPrint("-- Mapscript: Template loaded --") 21 | end 22 | 23 | function MAPSCRIPT:PostInit() 24 | if SERVER then 25 | for _, v in pairs(ents.FindByClass("item_suit")) do 26 | v:EnableRespawn(true) 27 | end 28 | end 29 | end 30 | 31 | function MAPSCRIPT:PostPlayerSpawn(ply) 32 | ----TEST_DbgPrint("PostPlayerSpawn") 33 | end 34 | 35 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c1a0d.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = false 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | --TEST_DbgPrint("-- Mapscript: Template loaded --") 21 | end 22 | 23 | function MAPSCRIPT:PostInit() 24 | if SERVER then 25 | for _, v in pairs(ents.FindByClass("item_suit")) do 26 | v:EnableRespawn(true) 27 | end 28 | end 29 | end 30 | 31 | function MAPSCRIPT:PostPlayerSpawn(ply) 32 | ----TEST_DbgPrint("PostPlayerSpawn") 33 | end 34 | 35 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/c1a0e.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {}, 10 | Ammo = {}, 11 | Armor = 0, 12 | HEV = true 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 17 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 18 | 19 | function MAPSCRIPT:Init() 20 | --TEST_DbgPrint("-- Mapscript: Template loaded --") 21 | end 22 | 23 | function MAPSCRIPT:PostInit() 24 | end 25 | 26 | function MAPSCRIPT:PostPlayerSpawn(ply) 27 | ----TEST_DbgPrint("PostPlayerSpawn") 28 | end 29 | 30 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl1s/mapscripts/template.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("MapScript") 6 | local MAPSCRIPT = {} 7 | MAPSCRIPT.PlayersLocked = false 8 | 9 | MAPSCRIPT.DefaultLoadout = { 10 | Weapons = {}, 11 | Ammo = {}, 12 | Armor = 0, 13 | HEV = true 14 | } 15 | 16 | MAPSCRIPT.InputFilters = {} 17 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 18 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 19 | MAPSCRIPT.VehicleGuns = true 20 | 21 | function MAPSCRIPT:Init() 22 | DbgPrint("-- Mapscript: Template loaded --") 23 | end 24 | 25 | function MAPSCRIPT:PostInit() 26 | end 27 | 28 | function MAPSCRIPT:PostPlayerSpawn(ply) 29 | --DbgPrint("PostPlayerSpawn") 30 | end 31 | 32 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/cl_localisation.lua: -------------------------------------------------------------------------------- 1 | if SERVER then AddCSLuaFile() end 2 | local LOCALISATION = {} 3 | LOCALISATION["english"] = {} 4 | return LOCALISATION -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_canals_02.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("MapScript") 6 | local MAPSCRIPT = {} 7 | MAPSCRIPT.PlayersLocked = false 8 | 9 | MAPSCRIPT.DefaultLoadout = { 10 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol"}, 11 | Ammo = { 12 | ["Pistol"] = 18 13 | }, 14 | Armor = 0, 15 | HEV = true 16 | } 17 | 18 | MAPSCRIPT.InputFilters = {} 19 | MAPSCRIPT.EntityFilterByClass = {} 20 | 21 | MAPSCRIPT.EntityFilterByName = { 22 | ["global_newgame_spawner_suit"] = true, 23 | ["global_newgame_spawner_crowbar"] = true, 24 | ["global_newgame_spawner_pistol"] = true 25 | } 26 | 27 | function MAPSCRIPT:PostInit() 28 | if SERVER then 29 | -- The map has two spawns both with the priority flag, so we gonna wipe them. 30 | for _, v in pairs(ents.FindByClass("info_player_start")) do 31 | DbgPrint("Removing start: " .. tostring(v)) 32 | v:Remove() 33 | end 34 | 35 | -- And create a default one. 36 | local spawn = ents.CreateSimple("info_player_start", { 37 | Pos = Vector(2896, -2272, -604), 38 | Ang = Angle(0, 90, 0) 39 | }) 40 | 41 | spawn.MasterSpawn = true 42 | ents.RemoveByClass("prop_physics", Vector(367, 70, -846.01397705078)) -- wooden plate shortcut 43 | -- -114.632774 -1179.170288 -847.968750 44 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-114.632774, -1179.170288, -847.968750), Angle(0, 90, 0)) 45 | local checkpointTrigger1 = ents.Create("trigger_once") 46 | checkpointTrigger1:SetupTrigger(Vector(-114.632774, -1179.170288, -847.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) 47 | 48 | checkpointTrigger1.OnTrigger = function(_, activator) 49 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 50 | end 51 | end 52 | end 53 | 54 | function MAPSCRIPT:PostPlayerSpawn(ply) 55 | --DbgPrint("PostPlayerSpawn") 56 | end 57 | 58 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_canals_05.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | MAPSCRIPT.DefaultLoadout = { 8 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1"}, 9 | Ammo = { 10 | ["Pistol"] = 18, 11 | ["SMG1"] = 45 12 | }, 13 | Armor = 0, 14 | HEV = true 15 | } 16 | 17 | MAPSCRIPT.InputFilters = {} 18 | MAPSCRIPT.EntityFilterByClass = {} 19 | MAPSCRIPT.EntityFilterByName = { 20 | ["global_newgame_entmaker"] = true, 21 | ["relay_rockfall_start"] = true -- Don't do that, its trivial. 22 | } 23 | 24 | local function FreezeEntitiesAt(pos, extent) 25 | local foundEnts = ents.FindInBox(pos - extent, pos + extent) 26 | for _, v in pairs(foundEnts) do 27 | local physObj = v:GetPhysicsObject() 28 | if IsValid(physObj) then 29 | physObj:EnableMotion(false) 30 | end 31 | end 32 | end 33 | 34 | function MAPSCRIPT:PostInit() 35 | if SERVER then 36 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(4149.820313, 3446.334229, -466.530853), Angle(0, -66, 0)) 37 | checkpoint1:SetVisiblePos(Vector(4240.543945, 3220.031982, -473.430939)) 38 | local checkpointTrigger1 = ents.Create("trigger_once") 39 | checkpointTrigger1:SetupTrigger(Vector(4236.846191, 3261.946289, -474.814972), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) 40 | checkpointTrigger1.OnTrigger = function(_, activator) 41 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 42 | end 43 | 44 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(7352.527344, 1597.768555, -447.968750), Angle(0, -90, 0)) 45 | checkpoint2:SetVisiblePos(Vector(6758.199219, 1572.104248, -447.968750)) 46 | local checkpointTrigger2 = ents.Create("trigger_once") 47 | checkpointTrigger2:SetupTrigger(Vector(6770.862793, 1569.191040, -447.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) 48 | checkpointTrigger2.OnTrigger = function(_, activator) 49 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 50 | end 51 | 52 | ents.WaitForEntityByName( 53 | "rotate_guncave_exit_wheel", 54 | function(ent) 55 | ent:Fire("Unlock") 56 | ent:Fire("AddOutput", "OnPressed relay_airboat_gateopen,Trigger") 57 | ent:Fire("AddOutput", "OnPressed ss_arlene_opengate,Kill") -- In case the player opens it dont play the scene. 58 | end 59 | ) 60 | 61 | -- Disable motion of some entities, they are odd to walk on in multiplayer. 62 | FreezeEntitiesAt(Vector(4172.168457, 5346.647461, -124.435822), Vector(10, 10, 10)) 63 | FreezeEntitiesAt(Vector(4397.086914, 5241.035645, -121.793793), Vector(10, 10, 10)) 64 | FreezeEntitiesAt(Vector(4246.002441, 4931.557129, -121.530907), Vector(10, 10, 10)) 65 | end 66 | end 67 | 68 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_canals_06.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1"}, 10 | Ammo = { 11 | ["Pistol"] = 18, 12 | ["SMG1"] = 45 13 | }, 14 | Armor = 0, 15 | HEV = true 16 | } 17 | 18 | MAPSCRIPT.InputFilters = {} 19 | MAPSCRIPT.EntityFilterByClass = {} 20 | 21 | MAPSCRIPT.EntityFilterByName = { 22 | ["global_newgame_spawner_suit"] = true, 23 | ["global_newgame_spawner_crowbar"] = true, 24 | ["global_newgame_spawner_pistol"] = true, 25 | ["global_newgame_spawner_smg"] = true, 26 | ["global_newgame_spawner_smg"] = true, 27 | ["global_newgame_ammo"] = true, 28 | } 29 | 30 | function MAPSCRIPT:PostInit() 31 | if SERVER then 32 | -- 140.128403 6230.728516 -91.836014 33 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-244.051270, 5727.869141, -237.508698), Angle(0, 90, 0)) 34 | checkpoint1:SetVisiblePos(Vector(236.710632, 6244.615234, -75.189445)) 35 | local checkpointTrigger1 = ents.Create("trigger_once") 36 | checkpointTrigger1:SetupTrigger(Vector(140.128403, 6230.728516, -91.836014), Angle(0, 0, 0), Vector(-550, -500, -150), Vector(350, 100, 180)) 37 | 38 | checkpointTrigger1.OnTrigger = function(_, activator) 39 | GAMEMODE:SetVehicleCheckpoint(Vector(-405.258606, 5841.114258, -212.960327), Angle(0, 0, 0)) 40 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 41 | end 42 | end 43 | end 44 | 45 | function MAPSCRIPT:PostPlayerSpawn(ply) 46 | --DbgPrint("PostPlayerSpawn") 47 | end 48 | 49 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_canals_08.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1"}, 10 | Ammo = { 11 | ["Pistol"] = 18, 12 | ["SMG1"] = 45 13 | }, 14 | Armor = 0, 15 | HEV = true 16 | } 17 | 18 | MAPSCRIPT.InputFilters = {} 19 | MAPSCRIPT.EntityFilterByClass = {} 20 | 21 | MAPSCRIPT.EntityFilterByName = { 22 | ["global_newgame_spawner_suit"] = true, 23 | ["global_newgame_spawner_crowbar"] = true, 24 | ["global_newgame_spawner_pistol"] = true, 25 | ["global_newgame_spawner_smg1"] = true, 26 | ["relay_locks_closegates"] = true -- Dont close the doors if we pass thru the gate 27 | } 28 | 29 | function MAPSCRIPT:PostInit() 30 | if SERVER then 31 | for _, v in pairs(ents.FindByClass("info_player_start")) do 32 | v:Remove() 33 | end 34 | 35 | local playerStart = ents.Create("info_player_start") 36 | playerStart:SetPos(Vector(7504, -11398, -412)) 37 | playerStart:Spawn() 38 | playerStart.MasterSpawn = true 39 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-486.748169, -329.674469, -591.968750), Angle(0, 90, 0)) 40 | checkpoint1:SetVisiblePos(Vector(-420.171631, -97.050110, -591.968750)) 41 | local checkpointTrigger1 = ents.Create("trigger_once") 42 | checkpointTrigger1:SetupTrigger(Vector(-480.402649, -58.779499, -575.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) 43 | 44 | checkpointTrigger1.OnTrigger = function(_, activator) 45 | GAMEMODE:SetVehicleCheckpoint(Vector(53.214970, -102.730621, -615.638123), Angle(0, -180, 0)) 46 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 47 | end 48 | 49 | -- -841.505310 -1408.689331 -382.968750 50 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-841.505310, -1408.689331, -382.968750), Angle(0, 90, 0)) 51 | local checkpointTrigger2 = ents.Create("trigger_once") 52 | checkpointTrigger2:SetupTrigger(Vector(-841.505310, -1408.689331, -382.968750), Angle(0, 0, 0), Vector(-100, -100, 0), Vector(100, 100, 180)) 53 | 54 | checkpointTrigger2.OnTrigger = function(_, activator) 55 | --GAMEMODE:SetVehicleCheckpoint(Vector(53.214970, -102.730621, -615.638123), Angle(0, -180, 0)) 56 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 57 | end 58 | 59 | -- It looks odd when they spawn right infront of one. 60 | ents.WaitForEntityByName("bunker_copmaker1", function(ent) 61 | ent:AddSpawnFlags(SF_NPCMAKER_HIDEFROMPLAYER) 62 | end) 63 | 64 | ents.WaitForEntityByName("bunker_copmaker2", function(ent) 65 | ent:AddSpawnFlags(SF_NPCMAKER_HIDEFROMPLAYER) 66 | end) 67 | end 68 | end 69 | 70 | function MAPSCRIPT:PostPlayerSpawn(ply) 71 | --DbgPrint("PostPlayerSpawn") 72 | end 73 | 74 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_canals_09.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357"}, 10 | Ammo = { 11 | ["Pistol"] = 60, 12 | ["SMG1"] = 60 13 | }, 14 | Armor = 0, 15 | HEV = true 16 | } 17 | 18 | MAPSCRIPT.InputFilters = {} 19 | MAPSCRIPT.EntityFilterByClass = {} 20 | 21 | MAPSCRIPT.EntityFilterByName = { 22 | ["global_newgame_spawner_suit"] = true, 23 | ["global_newgame_spawner_crowbar"] = true, 24 | ["global_newgame_spawner_pistol"] = true, 25 | ["global_newgame_spawner_smg"] = true, 26 | ["global_newgame_spawner_357"] = true, 27 | } 28 | 29 | function MAPSCRIPT:PostInit() 30 | end 31 | 32 | function MAPSCRIPT:PostPlayerSpawn(ply) 33 | end 34 | 35 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_canals_10.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("MapScript") 6 | local MAPSCRIPT = {} 7 | MAPSCRIPT.PlayersLocked = false 8 | 9 | MAPSCRIPT.DefaultLoadout = { 10 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357"}, 11 | Ammo = { 12 | ["Pistol"] = 18, 13 | ["SMG1"] = 45, 14 | ["357"] = 6 15 | }, 16 | Armor = 0, 17 | HEV = true 18 | } 19 | 20 | MAPSCRIPT.InputFilters = {} 21 | MAPSCRIPT.EntityFilterByClass = {} 22 | 23 | MAPSCRIPT.EntityFilterByName = { 24 | ["global_newgame_spawner_suit"] = true, 25 | ["global_newgame_spawner_crowbar"] = true, 26 | ["global_newgame_spawner_pistol"] = true, 27 | ["global_newgame_spawner_smg"] = true, 28 | ["global_newgame_spawner_357"] = true, 29 | } 30 | 31 | function MAPSCRIPT:PostInit() 32 | DbgPrint("MAPSCRIPT:PostInit") 33 | 34 | if SERVER then 35 | for k, v in pairs(ents.FindByClass("info_player_start")) do 36 | v:Remove() 37 | end 38 | 39 | local playerStart = ents.Create("info_player_start") 40 | playerStart:SetPos(Vector(11876.291016, -12289.263672, -526.052246)) 41 | playerStart:SetAngles(Angle(0, 100, 0)) 42 | playerStart:Spawn() 43 | playerStart.MasterSpawn = true 44 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(4757.852051, 9866.387695, -111.968750), Angle(0, 180, 0)) 45 | checkpoint1:SetVisiblePos(Vector(4269.533691, 9236.030273, -127.968750)) 46 | local checkpointTrigger1 = ents.Create("trigger_once") 47 | checkpointTrigger1:SetupTrigger(Vector(5046.067871, 9267.515625, -127.968750), Angle(0, 0, 0), Vector(-1500, -1000, -300), Vector(100, 600, 180)) 48 | 49 | checkpointTrigger1.OnTrigger = function(_, activator) 50 | GAMEMODE:SetVehicleCheckpoint(Vector(4270.903320, 9841.201172, -124.578499), Angle(0, 180, 0)) 51 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 52 | end 53 | end 54 | end 55 | 56 | function MAPSCRIPT:PostPlayerSpawn(ply) 57 | --DbgPrint("PostPlayerSpawn") 58 | end 59 | 60 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_canals_12.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357"}, 10 | Ammo = { 11 | ["Pistol"] = 18, 12 | ["SMG1"] = 45, 13 | ["357"] = 6 14 | }, 15 | Armor = 0, 16 | HEV = true 17 | } 18 | 19 | MAPSCRIPT.InputFilters = {} 20 | MAPSCRIPT.EntityFilterByClass = {} 21 | 22 | MAPSCRIPT.EntityFilterByName = { 23 | ["global_newgame_spawner_suit"] = true, 24 | ["global_newgame_spawner_crowbar"] = true, 25 | ["global_newgame_spawner_pistol"] = true, 26 | ["global_newgame_spawner_smg1"] = true, 27 | ["global_newgame_spawner_357"] = true, 28 | } 29 | 30 | MAPSCRIPT.VehicleGuns = true 31 | 32 | function MAPSCRIPT:PostInit() 33 | if SERVER then 34 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-961.568787, -1598.274902, 192.031250), Angle(0, 0, 0)) 35 | checkpoint1:SetVisiblePos(Vector(-496.403473, -2616.393066, 142.600739)) 36 | local checkpointTrigger1 = ents.Create("trigger_once") 37 | checkpointTrigger1:SetupTrigger(Vector(-520.426453, -2655.423828, 83.702911), Angle(0, 0, 0), Vector(-500, -200, 0), Vector(500, 200, 280)) 38 | 39 | checkpointTrigger1.OnTrigger = function(_, activator) 40 | GAMEMODE:SetVehicleCheckpoint(Vector(-845.746704, -1628.464966, 120.773956), Angle(0, -180, 0)) 41 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 42 | end 43 | end 44 | end 45 | 46 | function MAPSCRIPT:PostPlayerSpawn(ply) 47 | --DbgPrint("PostPlayerSpawn") 48 | end 49 | 50 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_canals_13.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("MapScript") 6 | local MAPSCRIPT = {} 7 | MAPSCRIPT.PlayersLocked = false 8 | 9 | MAPSCRIPT.DefaultLoadout = { 10 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357"}, 11 | Ammo = { 12 | ["Pistol"] = 18, 13 | ["SMG1"] = 45, 14 | ["357"] = 6 15 | }, 16 | Armor = 0, 17 | HEV = true 18 | } 19 | 20 | MAPSCRIPT.InputFilters = {} 21 | MAPSCRIPT.EntityFilterByClass = {} 22 | 23 | MAPSCRIPT.EntityFilterByName = { 24 | ["global_newgame_spawner_suit"] = true, 25 | ["global_newgame_spawner_crowbar"] = true, 26 | ["global_newgame_spawner_pistol"] = true, 27 | ["global_newgame_spawner_smg"] = true, 28 | ["global_newgame_spawner_357"] = true, 29 | ["canals_trigger_elitrans"] = true -- Do not changelevel based on the output. 30 | } 31 | 32 | MAPSCRIPT.VehicleGuns = true 33 | 34 | function MAPSCRIPT:PostInit() 35 | if SERVER then 36 | -- TODO: Duplicate canals_npc_reservoircopter01 (player / 2) times 37 | -- TODO: Trigger helicopter OnDeath outputs only if all of them are dead. 38 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(3435.695557, 1247.184448, -385.343903), Angle(0, 90, 0)) 39 | checkpoint1:SetVisiblePos(Vector(3369.119873, 2166.538818, -367.946716)) 40 | local checkpointTrigger1 = ents.Create("trigger_once") 41 | checkpointTrigger1:SetupTrigger(Vector(3425.643555, 2139.872314, -476.733490), Angle(0, 0, 0), Vector(-200, -400, 0), Vector(200, 400, 280)) 42 | 43 | --checkpointTrigger1:RemoveEffects(EF_NODRAW) 44 | checkpointTrigger1.OnTrigger = function(_, activator) 45 | GAMEMODE:SetVehicleCheckpoint(Vector(3437.813477, 1579.182251, -455.238220), Angle(0, -90, 0)) 46 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 47 | end 48 | 49 | -- We gotta place a giant changelevel trigger here, the other one is dangling in the air and uses Input instead of touch. 50 | -- -1024.000000 -6656.000000 -1262.920044 51 | -- *16 52 | local changelevelTrigger = ents.CreateSimple("trigger_changelevel", { 53 | Pos = Vector(-1024.000000, -6656.000000, -1262.920044), 54 | Ang = Angle(0, 0, 0), 55 | Model = "*16", 56 | KeyValues = { 57 | ["map"] = "d1_eli_01", 58 | ["landmark"] = "canals_trans_13_eli" 59 | } 60 | }) 61 | 62 | changelevelTrigger:Spawn() 63 | 64 | ents.WaitForEntityByName("lambda_canals_portal_elitrans", function(ent) 65 | DbgPrint("Fixing visibility") 66 | ent:Fire("Open") 67 | end) 68 | end 69 | end 70 | 71 | function MAPSCRIPT:PostPlayerSpawn(ply) 72 | --DbgPrint("PostPlayerSpawn") 73 | end 74 | 75 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_town_01.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 3 14 | }, 15 | Armor = 60, 16 | HEV = true 17 | } 18 | 19 | MAPSCRIPT.InputFilters = {} 20 | MAPSCRIPT.EntityFilterByClass = {} 21 | 22 | MAPSCRIPT.EntityFilterByName = { 23 | ["player_spawn_template"] = true 24 | } 25 | 26 | function MAPSCRIPT:PostInit() 27 | if SERVER then 28 | -- 2849.690674 -1397.864624 -3839.968750 29 | ents.WaitForEntityByName("null_filter", function(ent) 30 | ent:Remove() 31 | end) 32 | 33 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(2643.776611, -1465.673584, -3839.968750), Angle(0, 90, 0)) 34 | checkpoint1:SetVisiblePos(Vector(3005.009521, -1394.904053, -3783.968750)) 35 | local checkpointTrigger1 = ents.Create("trigger_once") 36 | checkpointTrigger1:SetupTrigger(Vector(3007.881836, -1393.500732, -3783.968750), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 70)) 37 | 38 | checkpointTrigger1.OnTrigger = function(_, activator) 39 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 40 | end 41 | 42 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(2018.717896, -1513.990112, -3839.968750), Angle(0, 90, 0)) 43 | checkpoint2:SetVisiblePos(Vector(2029.538086, -1425.406128, -3839.968750)) 44 | local checkpointTrigger2 = ents.Create("trigger_once") 45 | checkpointTrigger2:SetupTrigger(Vector(2029.538086, -1425.406128, -3839.968750), Angle(0, 0, 0), Vector(-90, -100, 0), Vector(70, 200, 50)) 46 | 47 | checkpointTrigger2.OnTrigger = function(_, activator) 48 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 49 | end 50 | end 51 | end 52 | 53 | function MAPSCRIPT:PostPlayerSpawn(ply) 54 | --DbgPrint("PostPlayerSpawn") 55 | end 56 | 57 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_town_01a.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 3 14 | }, 15 | Armor = 60, 16 | HEV = true 17 | } 18 | 19 | MAPSCRIPT.InputFilters = {} 20 | MAPSCRIPT.EntityFilterByClass = {} 21 | 22 | MAPSCRIPT.EntityFilterByName = { 23 | ["player_spawn_template"] = true 24 | } 25 | 26 | function MAPSCRIPT:PostInit() 27 | if SERVER then 28 | ents.WaitForEntityByName("portalwindow_03_portal", function(ent) 29 | ent:Fire("Open") 30 | end) 31 | 32 | ents.WaitForEntityByName("attic_door_1", function(ent) end) -- TODO: Investigate why this door is basically invisible + no collision but it exists -- when going from d1_town_01 to d1_town_01a 33 | end 34 | end 35 | 36 | function MAPSCRIPT:PostPlayerSpawn(ply) 37 | --DbgPrint("PostPlayerSpawn") 38 | end 39 | 40 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_town_02a.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 3, 14 | ["Grenade"] = 1, 15 | ["Buckshot"] = 12 16 | }, 17 | Armor = 60, 18 | HEV = true 19 | } 20 | 21 | MAPSCRIPT.InputFilters = {} 22 | MAPSCRIPT.EntityFilterByClass = {} 23 | 24 | MAPSCRIPT.EntityFilterByName = { 25 | ["startobjects"] = true 26 | } 27 | 28 | function MAPSCRIPT:PostInit() 29 | if SERVER then 30 | -- Figure out a better way to finish this scene. 31 | ents.RemoveByClass("trigger_once", Vector(-7504, -304, -3344)) 32 | end 33 | end 34 | 35 | function MAPSCRIPT:PostPlayerSpawn(ply) 36 | --DbgPrint("PostPlayerSpawn") 37 | end 38 | 39 | function MAPSCRIPT:FindUseEntity(ply, ent) 40 | if IsValid(ent) and (ent:GetName() == "graveyard_exit_lever_rot" or ent:GetName() == "graveyard_exit_momentary_wheel") then return NULL end 41 | end 42 | 43 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_town_03.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 3, 14 | ["Grenade"] = 1, 15 | ["Buckshot"] = 12 16 | }, 17 | Armor = 60, 18 | HEV = true 19 | } 20 | 21 | MAPSCRIPT.InputFilters = {} 22 | MAPSCRIPT.EntityFilterByClass = {} 23 | 24 | MAPSCRIPT.EntityFilterByName = { 25 | ["startobjects_template"] = true 26 | } 27 | 28 | function MAPSCRIPT:PostInit() 29 | if SERVER then 30 | -- FIX #73: If we are starting at 03 we have to correct the blockades since prev is 02 and next is 02. 31 | if GAMEMODE.IsChangeLevel == false then 32 | for k, v in pairs(ents.FindByClass("trigger_changelevel")) do 33 | if v.Landmark == "d1_town_03_02" then 34 | v:SetBlocked(false) 35 | elseif v.Landmark == "d1_town_02_03" then 36 | v:SetBlocked(true) 37 | end 38 | end 39 | end 40 | 41 | -- The player gets stuck here, so we just put something there so it wont happen. 42 | -- 43 | ents.CreateSimple("prop_physics", { 44 | Model = "models/props_debris/concrete_chunk02b.mdl", 45 | Pos = Vector(-3128.362549, -1026.139160, -3604.878906), 46 | Ang = Angle(2.362, -13.966, 9.108), 47 | MoveType = MOVETYPE_NONE, 48 | SpawnFlags = SF_PHYSPROP_MOTIONDISABLED, 49 | Flags = FL_STATICPROP 50 | }) 51 | end 52 | end 53 | 54 | function MAPSCRIPT:PostPlayerSpawn(ply) 55 | --DbgPrint("PostPlayerSpawn") 56 | end 57 | 58 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d1_town_04.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 3, 14 | ["Grenade"] = 1, 15 | ["Buckshot"] = 12 16 | }, 17 | Armor = 60, 18 | HEV = true 19 | } 20 | 21 | MAPSCRIPT.InputFilters = {} 22 | MAPSCRIPT.EntityFilterByClass = {} 23 | 24 | MAPSCRIPT.EntityFilterByName = { 25 | ["player_spawn_template"] = true 26 | } 27 | 28 | function MAPSCRIPT:PostInit() 29 | if SERVER then 30 | -- 1915.561768 -19.246124 -5120.762695 31 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(1893.508423, 365.617035, -5120.287109), Angle(0, -90, 0)) 32 | local checkpointTrigger1 = ents.Create("trigger_once") 33 | checkpointTrigger1:SetupTrigger(Vector(1915.561768, -19.246124, -5120.762695), Angle(0, 0, 0), Vector(-150, -50, 0), Vector(150, 50, 70)) 34 | 35 | checkpointTrigger1.OnTrigger = function(_, activator) 36 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 37 | end 38 | end 39 | end 40 | 41 | function MAPSCRIPT:PostPlayerSpawn(ply) 42 | --DbgPrint("PostPlayerSpawn") 43 | end 44 | 45 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d2_coast_01.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_shotgun", "weapon_ar2"}, 10 | --"weapon_frag", 11 | Ammo = { 12 | ["Pistol"] = 20, 13 | ["SMG1"] = 45, 14 | ["357"] = 6, 15 | --["Grenade"] = 3, 16 | ["Buckshot"] = 12, 17 | ["AR2"] = 50 18 | }, 19 | Armor = 60, 20 | HEV = true 21 | } 22 | 23 | MAPSCRIPT.InputFilters = { 24 | ["push_car_superjump_01"] = {"Disable"} 25 | } 26 | 27 | MAPSCRIPT.EntityFilterByClass = {} 28 | 29 | MAPSCRIPT.EntityFilterByName = { 30 | ["global_newgame_template_base_items"] = true, 31 | ["global_newgame_template_local_items"] = true, 32 | ["global_newgame_template_ammo"] = true, 33 | ["logic_jeepflipped"] = true -- Annoying 34 | } 35 | 36 | MAPSCRIPT.VehicleGuns = true 37 | 38 | function MAPSCRIPT:PostInit() 39 | if SERVER then 40 | ents.WaitForEntityByName("push_car_superjump_01", function(ent) 41 | ent:Fire("Enable") 42 | ent:SetName("Lambda_" .. ent:GetName()) -- Prevent anyone disabling it. 43 | end) 44 | end 45 | end 46 | 47 | function MAPSCRIPT:PostPlayerSpawn(ply) 48 | --DbgPrint("PostPlayerSpawn") 49 | end 50 | 51 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d2_coast_12.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["player_spawn_items_maker"] = true 30 | } 31 | 32 | MAPSCRIPT.GlobalStates = { 33 | ["antlion_allied"] = GLOBAL_ON 34 | } 35 | 36 | function MAPSCRIPT:PostInit() 37 | if SERVER then 38 | --3957.129150 -5952.989258 450.031250 39 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(3957.129150, -5952.989258, 450.031250), Angle(0, 45, 0)) 40 | local checkpointTrigger1 = ents.Create("trigger_once") 41 | checkpointTrigger1:SetupTrigger(Vector(3652.347900, -5942.446777, 450.478577), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) 42 | 43 | checkpointTrigger1.OnTrigger = function(_, activator) 44 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 45 | end 46 | 47 | -- 2141.143555 -346.152466 672.031250 48 | local checkpoint3 = GAMEMODE:CreateCheckpoint(Vector(2141.143555, -346.152466, 672.031250), Angle(0, 45, 0)) 49 | local checkpointTrigger3 = ents.Create("trigger_once") 50 | checkpointTrigger3:SetupTrigger(Vector(2141.143555, -346.152466, 672.031250), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) 51 | 52 | checkpointTrigger3.OnTrigger = function(_, activator) 53 | GAMEMODE:SetPlayerCheckpoint(checkpoint3, activator) 54 | end 55 | 56 | -- 4624.031250 4047.968750 848.031250 57 | local checkpoint5 = GAMEMODE:CreateCheckpoint(Vector(4624.031250, 4047.968750, 848.031250), Angle(0, 45, 0)) 58 | checkpoint5:SetVisiblePos(Vector(4958.799805, 3682.813721, 848.031250)) 59 | local checkpointTrigger5 = ents.Create("trigger_once") 60 | checkpointTrigger5:SetupTrigger(Vector(4900.396973, 3745.081543, 848.031250), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) 61 | 62 | checkpointTrigger5.OnTrigger = function(_, activator) 63 | GAMEMODE:SetPlayerCheckpoint(checkpoint5, activator) 64 | end 65 | end 66 | end 67 | 68 | function MAPSCRIPT:PostPlayerSpawn(ply) 69 | --DbgPrint("PostPlayerSpawn") 70 | end 71 | 72 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d2_prison_02.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["global_newgame_template_base_items"] = true, 30 | ["global_newgame_template_local_items"] = true, 31 | ["global_newgame_template_ammo"] = true 32 | } 33 | 34 | MAPSCRIPT.GlobalStates = { 35 | ["antlion_allied"] = GLOBAL_ON 36 | } 37 | 38 | function MAPSCRIPT:PostInit() 39 | ents.WaitForEntityByName("door_2", function(ent) 40 | ent:Fire("Unlock") 41 | end) 42 | 43 | if SERVER then 44 | --setpos -1384.557129 2894.679688 448.031250;setang -1.010203 -63.622845 0.000000 45 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-1384.557129, 2894.679688, 384.031250), Angle(0, 45, 0)) 46 | local checkpointTrigger1 = ents.Create("trigger_once") 47 | checkpointTrigger1:SetupTrigger(Vector(-1384.557129, 2894.679688, 384.031250), Angle(0, 0, 0), Vector(-100, -130, 0), Vector(50, 100, 200)) 48 | 49 | checkpointTrigger1.OnTrigger = function(_, activator) 50 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 51 | end 52 | 53 | -- cp 2 setpos -1951.139526 2554.889893 576.031250;setang 6.475924 -93.248947 0.000000 54 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-1951.139526, 2554.889893, 576.031250), Angle(0, 45, 0)) 55 | checkpoint2:SetVisiblePos(Vector(-1950.105469, 2715.927734, 512.031250)) 56 | local checkpointTrigger2 = ents.Create("trigger_once") 57 | checkpointTrigger2:SetupTrigger(Vector(-1952.149292, 2550.710938, 512.023621), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) 58 | 59 | checkpointTrigger2.OnTrigger = function(_, activator) 60 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 61 | end 62 | end 63 | end 64 | 65 | function MAPSCRIPT:PostPlayerSpawn(ply) 66 | --DbgPrint("PostPlayerSpawn") 67 | end 68 | 69 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d2_prison_03.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["playerclip_shower_dropdown"] = true, 30 | ["global_newgame_template_base_items"] = true, 31 | ["global_newgame_template_local_items"] = true, 32 | ["global_newgame_template_ammo"] = true 33 | } 34 | 35 | MAPSCRIPT.GlobalStates = { 36 | ["antlion_allied"] = GLOBAL_ON 37 | } 38 | 39 | function MAPSCRIPT:PostInit() 40 | if SERVER then 41 | -- Make sure the player spawns at the correct spot. 42 | local spawn = ents.Create("info_player_start") 43 | spawn:SetPos(Vector(-2378.219971, 3190.000000, 128.000000)) 44 | spawn:SetAngles(Angle(0, 180, 0)) 45 | spawn:SetKeyValue("spawnflags", "1") 46 | spawn:Spawn() 47 | -- -3566.677979 4935.034668 64.031250 48 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-3584.677979, 4911.034668, 0.031250), Angle(0, 45, 0)) 49 | local checkpointTrigger1 = ents.Create("trigger_once") 50 | checkpointTrigger1:SetupTrigger(Vector(-3584.677979, 4911.034668, 0.031250), Angle(0, 0, 0), Vector(-100, -150, 0), Vector(100, 150, 100)) 51 | 52 | checkpointTrigger1.OnTrigger = function(_, activator) 53 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 54 | end 55 | end 56 | end 57 | 58 | function MAPSCRIPT:PostPlayerSpawn(ply) 59 | --DbgPrint("PostPlayerSpawn") 60 | end 61 | 62 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d2_prison_04.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["global_newgame_template_base_items"] = true, 30 | ["global_newgame_template_local_items"] = true, 31 | ["global_newgame_template_ammo"] = true, 32 | ["closet_door_relay"] = true, 33 | } 34 | 35 | MAPSCRIPT.GlobalStates = { 36 | ["antlion_allied"] = GLOBAL_ON 37 | } 38 | 39 | function MAPSCRIPT:PostInit() 40 | if SERVER then 41 | -- -563.311829 1569.210205 448.031250 42 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-563.311829, 1569.210205, 384.163727), Angle(0, 45, 0)) 43 | local checkpointTrigger2 = ents.Create("trigger_once") 44 | checkpointTrigger2:SetupTrigger(Vector(-563.311829, 1569.210205, 384.163727), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 100)) 45 | 46 | checkpointTrigger2.OnTrigger = function(_, activator) 47 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 48 | end 49 | end 50 | end 51 | 52 | function MAPSCRIPT:PostPlayerSpawn(ply) 53 | --DbgPrint("PostPlayerSpawn") 54 | end 55 | 56 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_01.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = { 26 | ["doors_elevator_2"] = {"Close"}, 27 | ["doors_elevator_1"] = {"Close"}, 28 | ["timer_nag_leave_1"] = {"Kill"}, 29 | ["logic_nag_leave_1"] = {"Kill"} 30 | } 31 | 32 | MAPSCRIPT.EntityFilterByClass = {} 33 | 34 | MAPSCRIPT.EntityFilterByName = { 35 | ["global_newgame_template_base_items"] = true, 36 | ["global_newgame_template_local_items"] = true, 37 | ["global_newgame_template_ammo"] = true, 38 | ["trigger_closeTPDoor"] = true, 39 | ["teleport_screenoverlay_Kleiner_1"] = true 40 | } 41 | 42 | function MAPSCRIPT:PostInit() 43 | if SERVER then 44 | -- setpos -497.127838 29.422707 576.030090;setang 1.708000 -178.566528 0.000000 45 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-497.127838, 29.422707, 512.03009), Angle(0, 0, 0)) 46 | local checkpointTrigger1 = ents.Create("trigger_once") 47 | checkpointTrigger1:SetupTrigger(Vector(-497.127838, 29.422707, 576.030090), Angle(0, 0, 0), Vector(-100, -250, 0), Vector(100, 250, 200)) 48 | 49 | checkpointTrigger1.OnTrigger = function(_, activator) 50 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 51 | end 52 | 53 | ents.WaitForEntityByName("kleiner", function(ent) 54 | ent:SetHealth(100) 55 | end) 56 | end 57 | end 58 | 59 | function MAPSCRIPT:PostPlayerSpawn(ply) 60 | --DbgPrint("PostPlayerSpawn") 61 | end 62 | 63 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_02.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["global_newgame_template_base_items"] = true, 30 | ["global_newgame_template_local_items"] = true, 31 | ["global_newgame_template_ammo"] = true 32 | } 33 | 34 | function MAPSCRIPT:PostInit() 35 | if SERVER then 36 | ents.RemoveByClass("trigger_once", Vector(-5504, -5636, 30)) 37 | -- setpos -497.127838 29.422707 576.030090;setang 1.708000 -178.566528 0.000000 38 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-5478.429688, -5604.233887, -3.968750), Angle(0, 90, 0)) 39 | local checkpointTrigger1 = ents.Create("trigger_multiple") 40 | checkpointTrigger1:SetupTrigger(Vector(-7763.793945, -6373.333496, 10.588013), Angle(0, 0, 0), Vector(-3400, -1050, -100), Vector(2200, 1750, 300)) 41 | 42 | checkpointTrigger1.OnEndTouchAll = function(trigger) 43 | TriggerOutputs({{"relationship_soldiers_vs_dog_like", "RevertRelationship", 0, ""}, {"pclip_gate1", "Enable", 0, ""}, {"lcs_dog_nag_door_loop1", "Cancel", 0, ""}, {"lcs_dog_nag_door_loop1", "Kill", 0.10, ""}, {"relationship_soldiers_vs_dog_hate", "ApplyRelationship", 0.20, ""}, {"logic_dropshipStart", "Trigger", 1.00, ""}, {"ss_dog_ThruGate", "BeginSequence", 2.50, ""}, {"sound_dog_surprised_1", "PlaySound", 4.00, ""}, {"sound_dog_roar_1", "PlaySound", 6.00, ""}}) 44 | trigger:Remove() 45 | GAMEMODE:SetPlayerCheckpoint(checkpoint1) 46 | end 47 | end 48 | end 49 | 50 | function MAPSCRIPT:PostPlayerSpawn(ply) 51 | --DbgPrint("PostPlayerSpawn") 52 | end 53 | 54 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_03.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} --["env_global"] = true, 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["pclip_gate1"] = true, 30 | ["global_newgame_template_base_items"] = true, 31 | ["global_newgame_template_local_items"] = true, 32 | ["global_newgame_template_ammo"] = true 33 | } 34 | 35 | function MAPSCRIPT:PostInit() 36 | if SERVER then 37 | ents.WaitForEntityByName("trigger_tower", function(ent) 38 | -- Fail safe in case one decides to kill his allies. 39 | ent:Fire("AddOutput", "OnTrigger plaza_exit_relay,Trigger,,40,-1") 40 | end) 41 | 42 | -- setpos -497.127838 29.422707 576.030090;setang 1.708000 -178.566528 0.000000 43 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-2706.719727, -2843.710449, -3.968750), Angle(0, 90, 0)) 44 | local checkpointTrigger1 = ents.Create("trigger_once") 45 | checkpointTrigger1:SetupTrigger(Vector(-2706.719727, -2843.710449, -3.968750), Angle(0, 0, 0), Vector(-350, -300, 0), Vector(350, 300, 100)) 46 | 47 | checkpointTrigger1.OnTrigger = function(_, activator) 48 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 49 | end 50 | end 51 | end 52 | 53 | function MAPSCRIPT:PostPlayerSpawn(ply) 54 | --DbgPrint("PostPlayerSpawn") 55 | end 56 | 57 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_04.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["pclip_gate1"] = true, 30 | ["player_spawn_template"] = true 31 | } 32 | 33 | function MAPSCRIPT:PostInit() 34 | if SERVER then 35 | -- -1468.447632 -4747.628418 320.031250 36 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-1468.447632, -4747.628418, 320.031250), Angle(0, -90, 0)) 37 | local checkpointTrigger1 = ents.Create("trigger_once") 38 | checkpointTrigger1:SetupTrigger(Vector(-1468.447632, -4747.628418, 320.031250), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 130)) 39 | 40 | checkpointTrigger1.OnTrigger = function(_, activator) 41 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 42 | end 43 | end 44 | end 45 | 46 | function MAPSCRIPT:PostPlayerSpawn(ply) 47 | --DbgPrint("PostPlayerSpawn") 48 | end 49 | 50 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_06a.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["pclip_gate1"] = true, 30 | ["player_spawn_template"] = true 31 | } 32 | 33 | function MAPSCRIPT:PostInit() 34 | if SERVER then 35 | -- 1921.614014 -5632.266602 320.031250 36 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(3187.333984, 2184.848145, -312.009857), Angle(0, 180, 0)) 37 | checkpoint1:SetVisiblePos(Vector(3034.239258, 2188.360840, -318.995728)) 38 | local checkpointTrigger1 = ents.Create("trigger_once") 39 | checkpointTrigger1:SetupTrigger(Vector(3187.333984, 2184.848145, -312.009857), Angle(0, 0, 0), Vector(-250, -110, 0), Vector(110, 110, 100)) 40 | 41 | checkpointTrigger1.OnTrigger = function(_, activator) 42 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 43 | end 44 | 45 | -- 2937.786865 2507.701416 -319.968750 6.483 89.871 0.000 46 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(2667.206787, 3911.651367, -323.968750), Angle(0, 90, 0)) 47 | local checkpointTrigger2 = ents.Create("trigger_once") 48 | checkpointTrigger2:SetupTrigger(Vector(2945.403076, 2563.369629, -319.968750), Angle(0, 0, 0), Vector(-30, -30, 0), Vector(30, 30, 100)) 49 | 50 | checkpointTrigger2.OnTrigger = function(_, activator) 51 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 52 | end 53 | end 54 | end 55 | 56 | function MAPSCRIPT:PostPlayerSpawn(ply) 57 | --DbgPrint("PostPlayerSpawn") 58 | end 59 | 60 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_09.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = { 26 | ["sniper1"] = {"Kill"}, 27 | ["sniper2"] = {"Kill"} 28 | } 29 | 30 | MAPSCRIPT.EntityFilterByClass = {} 31 | 32 | MAPSCRIPT.EntityFilterByName = { 33 | ["player_spawn_items_maker"] = true 34 | } 35 | 36 | function MAPSCRIPT:PostInit() 37 | if SERVER then 38 | -- 7099.762695 6237.561523 0.031250 39 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(7405.353516, 6305.318848, 0.031250), Angle(0, 180, 0)) 40 | local checkpointTrigger1 = ents.Create("trigger_once") 41 | checkpointTrigger1:SetupTrigger(Vector(7099.762695, 6237.561523, 0.031250), Angle(0, 0, 0), Vector(-130, -130, 0), Vector(130, 130, 100)) 42 | 43 | checkpointTrigger1.OnTrigger = function(_, activator) 44 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 45 | end 46 | 47 | -- 6000.681641 6446.313477 96.031250 48 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(6000.681641, 6446.313477, 96.031250), Angle(0, 0, 0)) 49 | local checkpointTrigger2 = ents.Create("trigger_once") 50 | checkpointTrigger2:SetupTrigger(Vector(6000.681641, 6446.313477, 96.031250), Angle(0, 0, 0), Vector(-130, -130, 0), Vector(130, 130, 100)) 51 | 52 | checkpointTrigger2.OnTrigger = function(_, activator) 53 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 54 | end 55 | --[[ 56 | ents.WaitForEntityByName("sniper1", function(ent) 57 | ent:SetName("lambda_sniper1") 58 | end) 59 | 60 | ents.WaitForEntityByName("sniper2", function(ent) 61 | ent:SetName("lambda_sniper2") 62 | end) 63 | 64 | ents.WaitForEntityByName("sniper3", function(ent) 65 | ent:SetName("lambda_sniper3") 66 | end) 67 | 68 | ents.WaitForEntityByName("sniper4", function(ent) 69 | ent:SetName("lambda_sniper4") 70 | end) 71 | 72 | ents.WaitForEntityByName("sniper5", function(ent) 73 | ent:SetName("lambda_sniper5") 74 | end) 75 | ]] 76 | end 77 | end 78 | 79 | function MAPSCRIPT:PostPlayerSpawn(ply) 80 | --DbgPrint("PostPlayerSpawn") 81 | end 82 | 83 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_11.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["player_items_template"] = true, 30 | ["pclip_gate1"] = true 31 | } 32 | 33 | function MAPSCRIPT:PostInit() 34 | if SERVER then 35 | -- 1448.796265 4695.322266 960.031250 36 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(917.399902, 4806.428223, 960.031250), Angle(0, 0, 0)) 37 | checkpoint2:SetVisiblePos(Vector(1350.315063, 4729.931641, 960.031250)) 38 | local checkpointTrigger2 = ents.Create("trigger_once") 39 | checkpointTrigger2:SetupTrigger(Vector(1448.796265, 4695.322266, 960.031250), Angle(0, 0, 0), Vector(-160, -40, 0), Vector(60, 40, 100)) 40 | 41 | checkpointTrigger2.OnTrigger = function(_, activator) 42 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 43 | end 44 | 45 | ents.WaitForEntityByName("dropship_maker", function(ent) 46 | ent:Fire("AddOutput", "OnSpawnNPC !self,Kill,,0.0,-1") 47 | end) 48 | end 49 | end 50 | 51 | function MAPSCRIPT:PostPlayerSpawn(ply) 52 | --DbgPrint("PostPlayerSpawn") 53 | end 54 | 55 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_12.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | MAPSCRIPT.EntityFilterByClass = {} 27 | 28 | MAPSCRIPT.EntityFilterByName = { 29 | ["player_spawn_items"] = true, 30 | ["pclip_gate1"] = true 31 | } 32 | 33 | function MAPSCRIPT:PostInit() 34 | if SERVER then 35 | -- 1200.359985 3379.639893 768.816528 36 | -- Make sure the player spawns at the correct spot. 37 | local spawn = ents.Create("info_player_start") 38 | spawn:SetPos(Vector(1200.359985, 3379.639893, 768.816528)) 39 | spawn:SetAngles(Angle(0, -130, 0)) 40 | spawn:SetKeyValue("spawnflags", "1") 41 | spawn:Spawn() 42 | -- 645.813293 3391.362061 192.031250 43 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(645.813293, 3391.362061, 192.031250), Angle(0, -180, 0)) 44 | local checkpointTrigger1 = ents.Create("trigger_once") 45 | checkpointTrigger1:SetupTrigger(Vector(645.813293, 3391.362061, 192.031250), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 100)) 46 | 47 | checkpointTrigger1.OnTrigger = function(_, activator) 48 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 49 | end 50 | 51 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-2476.636963, 6708.353516, 128.031250), Angle(0, 90, 0)) 52 | checkpoint2:SetVisiblePos(Vector(-2494.347412, 6463.139648, 128.031250)) 53 | local checkpointTrigger2 = ents.Create("trigger_once") 54 | checkpointTrigger2:SetupTrigger(Vector(-2494.347412, 6463.139648, 128.031250), Angle(0, 0, 0), Vector(-50, -50, 0), Vector(50, 50, 100)) 55 | 56 | checkpointTrigger2.OnTrigger = function(_, activator) 57 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 58 | end 59 | end 60 | end 61 | 62 | function MAPSCRIPT:PostPlayerSpawn(ply) 63 | --DbgPrint("PostPlayerSpawn") 64 | end 65 | 66 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_c17_12b.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_lambda_medkit", "weapon_crowbar", "weapon_pistol", "weapon_smg1", "weapon_357", "weapon_physcannon", "weapon_frag", "weapon_shotgun", "weapon_ar2", "weapon_rpg", "weapon_crossbow", "weapon_bugbait"}, 10 | Ammo = { 11 | ["Pistol"] = 20, 12 | ["SMG1"] = 45, 13 | ["357"] = 6, 14 | ["Grenade"] = 3, 15 | ["Buckshot"] = 12, 16 | ["AR2"] = 50, 17 | ["RPG_Round"] = 8, 18 | ["SMG1_Grenade"] = 3, 19 | ["XBowBolt"] = 4 20 | }, 21 | Armor = 60, 22 | HEV = true 23 | } 24 | 25 | MAPSCRIPT.InputFilters = {} 26 | 27 | MAPSCRIPT.EntityFilterByClass = { 28 | ["npc_cscanner"] = true 29 | } 30 | 31 | MAPSCRIPT.EntityFilterByName = { 32 | ["player_spawn_items"] = true, 33 | ["pclip_gate1"] = true, 34 | ["entry_ceiling_debris_1"] = true, 35 | ["entry_ceiling_debris_clip_1"] = true 36 | } 37 | 38 | function MAPSCRIPT:PostInit() 39 | if SERVER then 40 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-4438.691406, 274.473907, -319.968750), Angle(0, 0, 0)) 41 | local checkpointTrigger1 = ents.Create("trigger_once") 42 | checkpointTrigger1:SetupTrigger(Vector(-4493.349121, 297.115906, -319.968750), Angle(0, 0, 0), Vector(-20, -20, 0), Vector(20, 20, 100)) 43 | 44 | checkpointTrigger1.OnTrigger = function(_, activator) 45 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 46 | end 47 | 48 | -- -4295.874023 430.960907 96.031250 49 | local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(-4295.874023, 430.960907, 96.031250), Angle(0, 90, 0)) 50 | local checkpointTrigger2 = ents.Create("trigger_once") 51 | checkpointTrigger2:SetupTrigger(Vector(-4295.874023, 430.960907, 96.031250), Angle(0, 0, 0), Vector(-20, -20, 0), Vector(20, 20, 100)) 52 | 53 | checkpointTrigger2.OnTrigger = function(_, activator) 54 | GAMEMODE:SetPlayerCheckpoint(checkpoint2, activator) 55 | end 56 | 57 | -- UGH 58 | --- -5204.569824 -29.101088 0.031250 59 | local striderTrigger = ents.Create("trigger_once") 60 | striderTrigger:SetupTrigger(Vector(-5204.569824, -29.101088, 0.031250), Angle(0, 0, 0), Vector(-300, -300, 0), Vector(300, 300, 100)) 61 | striderTrigger:Fire("AddOutput", "OnTrigger tunnel_strider_1,DisableCrouchWalk,,0.0,-1") 62 | striderTrigger:Fire("AddOutput", "OnTrigger tunnel_strider_1,Stand,,0.0,-1") 63 | striderTrigger:Fire("AddOutput", "OnTrigger tunnel_strider_1,SetTargetPath,tunnel_strider_1_path_3,0.1,-1") 64 | striderTrigger:Fire("AddOutput", "OnTrigger tunnel_strider_1,SetCannonTarget,second_floor_beam_1_bullseye_1,0.1,-1") 65 | end 66 | end 67 | 68 | function MAPSCRIPT:PostPlayerSpawn(ply) 69 | --DbgPrint("PostPlayerSpawn") 70 | end 71 | 72 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/d3_citadel_04.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.PlayersLocked = false 7 | 8 | MAPSCRIPT.DefaultLoadout = { 9 | Weapons = {"weapon_physcannon"}, 10 | Ammo = {}, 11 | Armor = 60, 12 | HEV = true 13 | } 14 | 15 | MAPSCRIPT.InputFilters = {} 16 | MAPSCRIPT.EntityFilterByClass = {} 17 | 18 | MAPSCRIPT.EntityFilterByName = { 19 | ["global_newgame_template_base_items"] = true, 20 | ["global_newgame_template_ammo"] = true, 21 | ["global_newgame_template_local_items"] = true 22 | } 23 | 24 | MAPSCRIPT.GlobalStates = { 25 | ["super_phys_gun"] = GLOBAL_ON 26 | } 27 | 28 | function MAPSCRIPT:PostInit() 29 | if SERVER then 30 | ents.WaitForEntityByName("citadel_trigger_elevatorride_up", function(elevatorTrigger) 31 | elevatorTrigger:SetKeyValue("teamwait", "1") 32 | 33 | ents.WaitForEntityByName("citadel_train_lift01_1", function(elevator) 34 | -- Checkpoint on elevator. 35 | local pos = elevator:GetPos() 36 | local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(262.721558, 803.862915, pos.z + 5), Angle(0, -180, 0)) 37 | checkpoint1:SetParent(elevator) 38 | 39 | elevatorTrigger.OnTrigger = function(_, activator) 40 | GAMEMODE:SetPlayerCheckpoint(checkpoint1, activator) 41 | end 42 | end) 43 | end) 44 | 45 | end 46 | end 47 | 48 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2/mapscripts/template.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("MapScript") 6 | local MAPSCRIPT = {} 7 | MAPSCRIPT.PlayersLocked = false 8 | 9 | MAPSCRIPT.DefaultLoadout = { 10 | Weapons = {}, 11 | Ammo = {}, 12 | Armor = 0, 13 | HEV = true 14 | } 15 | 16 | MAPSCRIPT.InputFilters = {} 17 | MAPSCRIPT.EntityFilterByClass = {} 18 | MAPSCRIPT.EntityFilterByName = {} --["spawnitems_template"] = true, 19 | MAPSCRIPT.VehicleGuns = true 20 | 21 | function MAPSCRIPT:Init() 22 | DbgPrint("-- Mapscript: Template loaded --") 23 | end 24 | 25 | function MAPSCRIPT:PostInit() 26 | end 27 | 28 | function MAPSCRIPT:PostPlayerSpawn(ply) 29 | --DbgPrint("PostPlayerSpawn") 30 | end 31 | 32 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2dm/cl_localisation.lua: -------------------------------------------------------------------------------- 1 | if SERVER then AddCSLuaFile() end 2 | local LOCALISATION = {} 3 | LOCALISATION["english"] = {} 4 | return LOCALISATION -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep1.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local GAMETYPE = {} 6 | GAMETYPE.Name = "Half-Life 2: Episode 1" 7 | GAMETYPE.InternalName = "episodic" 8 | GAMETYPE.BaseGameType = "hl2" 9 | GAMETYPE.MapScript = {} 10 | GAMETYPE.MapList = {"ep1_citadel_00", "ep1_citadel_01", "ep1_citadel_02", "ep1_citadel_02b", "ep1_citadel_03", "ep1_citadel_04", "ep1_c17_00", "ep1_c17_00a", "ep1_c17_01", "ep1_c17_02", "ep1_c17_02b", "ep1_c17_02a", "ep1_c17_05", "ep1_c17_06"} 11 | 12 | GAMETYPE.CampaignNames = { 13 | ["UNDUE ALARM"] = { 14 | s = 1, 15 | e = 4 16 | }, 17 | ["DIRECT INTERVENTION"] = { 18 | s = 5, 19 | e = 6 20 | }, 21 | ["LOWLIFE"] = { 22 | s = 7, 23 | e = 8 24 | }, 25 | ["URBAN FLIGHT"] = { 26 | s = 9, 27 | e = 13 28 | }, 29 | ["EXIT 17"] = { 30 | s = 14, 31 | e = 15 32 | } 33 | } 34 | GAMETYPE.Localisation = include("hl2ep1/cl_localisation.lua") 35 | 36 | function GAMETYPE:InitSettings() 37 | self.Base:InitSettings() 38 | end 39 | 40 | function GAMETYPE:LoadCurrentMapScript() 41 | self.Base.LoadMapScript(self, "lambda/gamemode/gametypes/hl2ep1", game.GetMap():lower()) 42 | end 43 | 44 | function GAMETYPE:GetPlayerLoadout() 45 | return self.MapScript.DefaultLoadout 46 | end 47 | 48 | hook.Add("LambdaLoadGameTypes", "HL2EP1GameType", function(gametypes) 49 | gametypes:Add("hl2ep1", GAMETYPE) 50 | end) 51 | 52 | if CLIENT then 53 | surface.CreateFont("ClientTitleFont", { 54 | font = "HL2EP2", -- EP1 font didn't work and they are the same anyways 55 | size = util.ScreenScaleH(34), 56 | weight = 0, 57 | antialias = true, 58 | additive = true, 59 | custom = true 60 | }) 61 | end -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep1/cl_localisation.lua: -------------------------------------------------------------------------------- 1 | if SERVER then AddCSLuaFile() end 2 | local LOCALISATION = {} 3 | LOCALISATION["english"] = {} 4 | return LOCALISATION -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep1/mapscripts/ep1_c17_00.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = {"weapon_lambda_medkit", "weapon_physcannon"}, 8 | Ammo = {}, 9 | Armor = 0, 10 | HEV = true 11 | } 12 | 13 | MAPSCRIPT.InputFilters = {} 14 | MAPSCRIPT.EntityFilterByClass = {} 15 | MAPSCRIPT.EntityFilterByName = { 16 | ["door_blocker"] = true, 17 | ["suit"] = true, 18 | ["physcannon"] = true 19 | } 20 | 21 | MAPSCRIPT.GlobalStates = { 22 | ["super_phys_gun"] = GLOBAL_OFF 23 | } 24 | 25 | MAPSCRIPT.Checkpoints = { 26 | { 27 | Pos = Vector(4352, -4260, -119), 28 | Ang = Angle(0, 90, 0), 29 | Trigger = { 30 | Pos = Vector(4292, -4130, -119), 31 | Mins = Vector(-25, -25, 0), 32 | Maxs = Vector(25, 25, 100) 33 | } 34 | }, 35 | { 36 | Pos = Vector(4427, -281, -96), 37 | Ang = Angle(0, 90, 0), 38 | Trigger = { 39 | Pos = Vector(4448, -288, -40), 40 | Mins = Vector(-27, -64, -70), 41 | Maxs = Vector(27, 64, 70) 42 | } 43 | }, 44 | { 45 | Pos = Vector(3550.521240, 1506.495483, 140.031250), 46 | Ang = Angle(0, -180, 0), 47 | Trigger = { 48 | Pos = Vector(3500.521240, 1506.495483, 140.031250), 49 | Mins = Vector(-55, -25, 0), 50 | Maxs = Vector(55, 25, 100) 51 | } 52 | } 53 | } 54 | 55 | function MAPSCRIPT:PostInit() 56 | 57 | -- Make the door after the barnacle area open and ignore player interaction 58 | ents.WaitForEntityByName("barnacle_exit_door", function(ent) 59 | ent:RemoveSpawnFlags(8192) 60 | ent:AddSpawnFlags(32768) 61 | ent:Fire("Open") 62 | end) 63 | 64 | -- Also remove the playerclip behind the door 65 | ents.WaitForEntityByName("barnacle_exit_door_clip", function(ent) 66 | ent:Remove() 67 | end) 68 | 69 | end 70 | 71 | function MAPSCRIPT:PostPlayerSpawn(ply) 72 | end 73 | 74 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep1/mapscripts/ep1_c17_00a.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = {"weapon_lambda_medkit", "weapon_physcannon", "weapon_pistol", "weapon_shotgun"}, 8 | Ammo = { 9 | ["Pistol"] = 18, 10 | ["Buckshot"] = 12 11 | }, 12 | Armor = 0, 13 | HEV = true 14 | } 15 | 16 | MAPSCRIPT.InputFilters = {} 17 | MAPSCRIPT.EntityFilterByClass = {} 18 | MAPSCRIPT.EntityFilterByName = { 19 | ["door_blocker"] = true, 20 | ["suit"] = true, 21 | ["physcannon"] = true, 22 | ["weapons"] = true 23 | } 24 | 25 | MAPSCRIPT.GlobalStates = { 26 | ["super_phys_gun"] = GLOBAL_OFF 27 | } 28 | 29 | MAPSCRIPT.Checkpoints = { 30 | { 31 | Pos = Vector(1161.264038, 4318.854980, 628.031250), 32 | Ang = Angle(0, 90, 0), 33 | Trigger = { 34 | Pos = Vector(1161.264038, 4318.854980, 628.031250), 35 | Mins = Vector(-25, -25, 0), 36 | Maxs = Vector(25, 25, 100) 37 | } 38 | } 39 | } 40 | 41 | function MAPSCRIPT:PostInit() 42 | if SERVER then 43 | -- Prevent door from closing when entering the elevator waiting room 44 | ents.WaitForEntityByName("math_count_door", function(ent) 45 | ent:Remove() 46 | end) 47 | 48 | -- Add checkpoint in elevator wait room 49 | ents.WaitForEntityByName("trigger_door_close", function(ent) 50 | ent.OnStartTouch = function() 51 | local elevfightcp = GAMEMODE:CreateCheckpoint(Vector(4436, 3578, 414), Angle(0, 90, 0)) 52 | GAMEMODE:SetPlayerCheckpoint(elevfightcp) 53 | end 54 | end) 55 | 56 | -- Remove default elevator player entry trigger 57 | ents.WaitForEntityByName("trigger_elevator_player", function(ent) 58 | ent:Remove() 59 | end) 60 | 61 | ents.WaitForEntityByName("ss_alyx_elevator_lean", function(ent) 62 | ent:SetKeyValue("onplayerdeath", "0") 63 | end) 64 | 65 | -- Add a new one with a teamwait value 66 | local elevTrigger = ents.Create("trigger_once") 67 | elevTrigger:SetupTrigger(Vector(4644, 3584, 481.5), Angle(0, 0, 0), Vector(-100, -100, -50), Vector(100, 100, 50)) 68 | elevTrigger:SetKeyValue("teamwait", "1") 69 | elevTrigger.OnTrigger = function(trigger) 70 | TriggerOutputs({{"counter_elevator", "Add", 0.0, "1"}}) 71 | end 72 | end 73 | end 74 | 75 | function MAPSCRIPT:PostPlayerSpawn(ply) 76 | end 77 | 78 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep1/mapscripts/ep1_c17_01.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = {"weapon_lambda_medkit", "weapon_physcannon", "weapon_pistol", "weapon_shotgun"}, 8 | Ammo = { 9 | ["Pistol"] = 18, 10 | ["Buckshot"] = 12 11 | }, 12 | Armor = 0, 13 | HEV = true 14 | } 15 | 16 | MAPSCRIPT.InputFilters = {} 17 | MAPSCRIPT.EntityFilterByClass = { 18 | ["weapon_physcannon"] = true, 19 | ["weapon_pistol"] = true, 20 | ["weapon_shotgun"] = true 21 | } 22 | 23 | MAPSCRIPT.EntityFilterByName = { 24 | ["door_blocker"] = true, 25 | ["suit"] = true, 26 | ["physcannon"] = true, 27 | ["weapons"] = true 28 | } 29 | 30 | MAPSCRIPT.GlobalStates = { 31 | ["super_phys_gun"] = GLOBAL_OFF 32 | } 33 | 34 | MAPSCRIPT.Checkpoints = { 35 | { 36 | Pos = Vector(2660, -1324, 8), 37 | Ang = Angle(0, 90, 0), 38 | Trigger = { 39 | Pos = Vector(2828, -1360, 68), 40 | Mins = Vector(-75, -75, -44), 41 | Maxs = Vector(75, 75, 44) 42 | } 43 | }, 44 | { 45 | Pos = Vector(1871, 2071, 33), 46 | Ang = Angle(0, 90, 0), 47 | Trigger = { 48 | Pos = Vector(1844, 1878, 78), 49 | Mins = Vector(-100, -160, -75), 50 | Maxs = Vector(100, 160, 75) 51 | } 52 | }, 53 | { 54 | Pos = Vector(100, 695, 174), 55 | Ang = Angle(0, 90, 0), 56 | Trigger = { 57 | Pos = Vector(109, 692, 216), 58 | Mins = Vector(-65, -30, -40), 59 | Maxs = Vector(65, 30, 40) 60 | } 61 | }, 62 | { 63 | Pos = Vector(-848, 160, 64), 64 | Ang = Angle(0, 90, 0), 65 | Trigger = { 66 | Pos = Vector(-848, 160, 64), 67 | Mins = Vector(-105, -105, -65), 68 | Maxs = Vector(105, 105, 65) 69 | } 70 | }, 71 | } 72 | 73 | function MAPSCRIPT:PostInit() 74 | if SERVER then 75 | -- Use the combine wall open trigger to add weapon_smg1 to the map loadout 76 | ents.WaitForEntityByName("trigger_combine_wall", function (ent) 77 | local loadout = GAMEMODE:GetMapScript().DefaultLoadout 78 | table.insert(loadout.Weapons, "weapon_smg1") 79 | end) 80 | 81 | -- Remove counter that closes dowmn the combine wall. Maybe improve this later to close when everyone is here 82 | ents.WaitForEntityByName("Crushing_wall_counter", function(ent) 83 | ent:Remove() 84 | end) 85 | end 86 | end 87 | 88 | function MAPSCRIPT:PostPlayerSpawn(ply) 89 | end 90 | 91 | function MAPSCRIPT:EntityKeyValue(ent, key, val) 92 | -- Known engine bug with func_movelinear. If parented the move direction is incorrect. 93 | if ent:GetClass() == "func_movelinear" and key == "parentname" then 94 | return "0" 95 | end 96 | end 97 | 98 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep1/mapscripts/ep1_c17_02.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = {"weapon_lambda_medkit", "weapon_physcannon", "weapon_pistol", "weapon_smg1", "weapon_shotgun"}, 8 | Ammo = { 9 | ["Pistol"] = 18, 10 | ["SMG1"] = 45, 11 | ["Buckshot"] = 12 12 | }, 13 | Armor = 0, 14 | HEV = true 15 | } 16 | 17 | MAPSCRIPT.InputFilters = {} 18 | MAPSCRIPT.EntityFilterByClass = { 19 | ["weapon_pistol"] = true -- The weapon is not a part of any spawner template so we have to remove it here 20 | } 21 | MAPSCRIPT.EntityFilterByName = { 22 | ["global_newgame_spawner_suit"] = true, 23 | ["global_newgame_spawner_physcannon"] = true, 24 | ["global_newgame_spawner_shotgun"] = true, 25 | ["global_newgame_spawner_smg"] = true, 26 | ["global_newgame_template_ammo"] = true, 27 | ["global_newgame_spawner_ammo"] = true 28 | } 29 | 30 | MAPSCRIPT.GlobalStates = { 31 | ["super_phys_gun"] = GLOBAL_OFF 32 | } 33 | 34 | MAPSCRIPT.Checkpoints = { 35 | { 36 | Pos = Vector(698, 38, 150), 37 | Ang = Angle(0, 90, 0), 38 | Trigger = { 39 | Pos = Vector(698, 38, 200), 40 | Mins = Vector(-62, -86, -56), 41 | Maxs = Vector(62, 86, 56) 42 | } 43 | }, 44 | { 45 | Pos = Vector(-1803, 2079, -119), 46 | Ang = Angle(0, 90, 0), 47 | Trigger = { 48 | Pos = Vector(-1788, 2068, -86), 49 | Mins = Vector(-180, -150, -50), 50 | Maxs = Vector(180, 150, 50) 51 | } 52 | } 53 | } 54 | 55 | function MAPSCRIPT:PostInit() 56 | -- Add ar2 and frags to player loadout when entering the ambush room 57 | local loadoutTrigger = ents.Create("trigger_once") 58 | loadoutTrigger:SetupTrigger(Vector(1276, -428, 71), Angle(0, 90, 0), Vector(-27, -8, -55), Vector(27, 8, 55)) 59 | loadoutTrigger.OnTrigger = function() 60 | DbgPrint("Adding AR2 and frags to player loadout") 61 | local loadout = GAMEMODE:GetMapScript().DefaultLoadout 62 | table.insert(loadout.Weapons, "weapon_ar2") 63 | table.insert(loadout.Weapons, "weapon_frag") 64 | end 65 | end 66 | 67 | function MAPSCRIPT:PostPlayerSpawn(ply) 68 | end 69 | 70 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep1/mapscripts/ep1_c17_02b.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = {"weapon_lambda_medkit", "weapon_physcannon", "weapon_pistol", "weapon_smg1", "weapon_shotgun", "weapon_frag", "weapon_ar2"}, 8 | Ammo = { 9 | ["Pistol"] = 18, 10 | ["SMG1"] = 45, 11 | ["357"] = 6, 12 | ["Buckshot"] = 12, 13 | ["Grenade"] = 3, 14 | ["AR2"] = 50, 15 | ["SMG1_Grenade"] = 1, 16 | }, 17 | Armor = 0, 18 | HEV = true 19 | } 20 | 21 | MAPSCRIPT.InputFilters = {} 22 | MAPSCRIPT.EntityFilterByClass = { 23 | ["weapon_pistol"] = true -- The weapon is not a part of any spawner template so we have to remove it here 24 | } 25 | MAPSCRIPT.EntityFilterByName = { 26 | ["global_newgame_spawner_suit"] = true, 27 | ["global_newgame_spawner_physcannon"] = true, 28 | ["global_newgame_spawner_shotgun"] = true, 29 | ["global_newgame_spawner_smg"] = true, 30 | ["global_newgame_spawner_ar2"] = true, 31 | ["global_newgame_template_ammo"] = true, 32 | ["global_newgame_spawner_ammo"] = true 33 | } 34 | 35 | MAPSCRIPT.GlobalStates = { 36 | ["super_phys_gun"] = GLOBAL_OFF 37 | } 38 | MAPSCRIPT.ImportantPlayerNPCNames = { 39 | ["citizen_raid_doorblocker"] = true, 40 | } 41 | 42 | MAPSCRIPT.Checkpoints = { 43 | { 44 | Pos = Vector(1130, 1845, -247), 45 | Ang = Angle(0, 90, 0), 46 | Trigger = { 47 | Pos = Vector(1088.5, 1806.5, -195.49), 48 | Mins = Vector(-112, -140, -60), 49 | Maxs = Vector(112, 140, 60) 50 | } 51 | }, 52 | { 53 | Pos = Vector(1203, 1911, 141), 54 | Ang = Angle(0, 90, 0), 55 | Trigger = { 56 | Pos = Vector(1311, 1844, 192), 57 | Mins = Vector(-30, -180, -60), 58 | Maxs = Vector(30, 180, 60) 59 | } 60 | }, 61 | { 62 | Pos = Vector(569, 2776, 265), 63 | Ang = Angle(0, 90, 0), 64 | Trigger = { 65 | Pos = Vector(586, 2776, 312), 66 | Mins = Vector(-111, -87, -48), 67 | Maxs = Vector(111, 87, 48) 68 | } 69 | }, 70 | } 71 | 72 | function MAPSCRIPT:PostInit() 73 | end 74 | 75 | function MAPSCRIPT:PostPlayerSpawn(ply) 76 | end 77 | 78 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep1/mapscripts/ep1_citadel_02.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = {"weapon_lambda_medkit", "weapon_physcannon"}, 8 | Ammo = {}, 9 | Armor = 0, 10 | HEV = true 11 | } 12 | 13 | MAPSCRIPT.InputFilters = {} 14 | MAPSCRIPT.EntityFilterByClass = {} 15 | MAPSCRIPT.EntityFilterByName = { 16 | ["global_newgame_spawner_suit"] = true, 17 | ["global_newgame_spawner_physcannon"] = true 18 | } 19 | 20 | MAPSCRIPT.GlobalStates = { 21 | ["super_phys_gun"] = GLOBAL_ON 22 | } 23 | 24 | MAPSCRIPT.Checkpoints = { 25 | { 26 | Pos = Vector(-1657, 947, 821), 27 | Ang = Angle(0, 0, 0), 28 | Trigger = { 29 | Pos = Vector(-2008, 960, 852), 30 | Mins = Vector(-128, -40, -52), 31 | Maxs = Vector(128, 40, 52) 32 | } 33 | } 34 | } 35 | 36 | function MAPSCRIPT:PostInit() 37 | end 38 | 39 | function MAPSCRIPT:PostPlayerSpawn(ply) 40 | end 41 | 42 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local GAMETYPE = {} 6 | GAMETYPE.Name = "Half-Life 2: Episode 2" 7 | GAMETYPE.InternalName = "ep2" 8 | GAMETYPE.BaseGameType = "hl2" 9 | GAMETYPE.MapScript = {} 10 | GAMETYPE.MapList = { 11 | "ep2_outland_01", 12 | "ep2_outland_01a", 13 | "ep2_outland_02", 14 | "ep2_outland_03", 15 | "ep2_outland_04", 16 | "ep2_outland_02", 17 | "ep2_outland_05", 18 | "ep2_outland_06", 19 | "ep2_outland_06a", 20 | "ep2_outland_07", 21 | "ep2_outland_08", 22 | "ep2_outland_09", 23 | "ep2_outland_10", 24 | "ep2_outland_10a", 25 | "ep2_outland_11", 26 | "ep2_outland_11a", 27 | "ep2_outland_11b", 28 | "ep2_outland_12", 29 | "ep2_outland_12a", 30 | } 31 | 32 | GAMETYPE.CampaignNames = { 33 | ["To the White Forest"] = { 34 | s = 1, 35 | e = 2 36 | }, 37 | ["This Vortal Coil"] = { 38 | s = 3, 39 | e = 5 40 | }, 41 | ["Freeman Pontifex"] = { 42 | s = 6, 43 | e = 7 44 | }, 45 | ["Riding Shotgun"] = { 46 | s = 8, 47 | e = 10 48 | }, 49 | ["Under the Radar"] = { 50 | s = 11, 51 | e = 13 52 | }, 53 | ["Our Mutual Fiend"] = { 54 | s = 14, 55 | e = 17 56 | }, 57 | ["T-Minus One"] = { 58 | s = 18, 59 | e = 18 60 | } 61 | } 62 | GAMETYPE.Localisation = include("hl2ep2/cl_localisation.lua") 63 | GAMETYPE.ModelRemapping = { 64 | ["models/advisor.mdl"] = "models/advisor_ep2.mdl", 65 | ["models/lamarr.mdl"] = "models/lamarr_ep2.mdl", 66 | } 67 | 68 | function GAMETYPE:InitSettings() 69 | self.Base:InitSettings() 70 | end 71 | 72 | function GAMETYPE:LoadCurrentMapScript() 73 | self.Base.LoadMapScript(self, "lambda/gamemode/gametypes/hl2ep2", game.GetMap():lower()) 74 | end 75 | 76 | function GAMETYPE:GetPlayerLoadout() 77 | return self.MapScript.DefaultLoadout 78 | end 79 | 80 | hook.Add("LambdaLoadGameTypes", "HL2EP2GameType", function(gametypes) 81 | gametypes:Add("hl2ep2", GAMETYPE) 82 | end) 83 | 84 | if CLIENT then 85 | surface.CreateFont("ClientTitleFont", { 86 | font = "HL2EP2", 87 | size = util.ScreenScaleH(34), 88 | weight = 0, 89 | antialias = true, 90 | additive = true, 91 | custom = true 92 | }) 93 | end -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2/cl_localisation.lua: -------------------------------------------------------------------------------- 1 | if SERVER then AddCSLuaFile() end 2 | local LOCALISATION = {} 3 | LOCALISATION["english"] = {} 4 | return LOCALISATION -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2/mapscripts/ep2_outland_05.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = { 8 | "weapon_lambda_medkit", 9 | "weapon_physcannon", 10 | "weapon_crowbar", 11 | "weapon_frag", 12 | "weapon_357", 13 | "weapon_shotgun", 14 | "weapon_pistol", 15 | "weapon_smg1", 16 | }, 17 | Ammo = { 18 | ["SMG1"] = 45, 19 | ["Buckshot"] = 6, 20 | ["Pistol"] = 18, 21 | ["Grenade"] = 3, 22 | ["357"] = 6, 23 | ["SMG1_Grenade"] = 1, 24 | }, 25 | Armor = 0, 26 | HEV = true 27 | } 28 | 29 | MAPSCRIPT.InputFilters = {} 30 | MAPSCRIPT.EntityFilterByClass = {} 31 | MAPSCRIPT.EntityFilterByName = { 32 | ["spawnitems"] = true, 33 | ["player_on_trigger"] = true, -- elevator related trigger 34 | ["player_off_buildingtop_trigger"] = true -- best to remove this one 35 | } 36 | 37 | MAPSCRIPT.GlobalStates = { 38 | } 39 | 40 | MAPSCRIPT.Checkpoints = { 41 | { 42 | Pos = Vector(-668, -440, 6), 43 | Ang = Angle(0, 0, 0), 44 | Trigger = { 45 | Pos = Vector(-696, -1025, 424), 46 | Mins = Vector(-182, -2024, -444), 47 | Maxs = Vector(182, 2024, 444) 48 | } 49 | }, 50 | { 51 | Pos = Vector(-256, 3840, 84), 52 | Ang = Angle(0, 0, 0), 53 | Trigger = { 54 | Pos = Vector(-192, 4032, -8), 55 | Mins = Vector(-224, -265, -104), 56 | Maxs = Vector(224, 265, 104) 57 | } 58 | }, 59 | } 60 | 61 | function MAPSCRIPT:PostInit() 62 | -- Redo elevator logic to wait for everyone 63 | local elevator 64 | ents.WaitForEntityByName("basket_brushes", function(ent) 65 | elevator = ent 66 | end) 67 | 68 | local elevatorWait = ents.Create("trigger_once") 69 | elevatorWait:SetupTrigger(Vector(660, 5760, 30), Angle(0, 0, 0), Vector(-52, -36, -20), Vector(52, 36, 20)) 70 | elevatorWait:SetKeyValue("teamwait", 1) 71 | elevatorWait:AddOutput("OnTrigger", "player_branch", "SetValue", "1", 0.0, "-1") 72 | elevatorWait.OnTrigger = function(_, activator) 73 | local elevCP = GAMEMODE:CreateCheckpoint(Vector(656, 5760, 35)) 74 | elevCP:SetParent(elevator) 75 | GAMEMODE:SetPlayerCheckpoint(elevCP, activator) 76 | end 77 | end 78 | 79 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2/mapscripts/ep2_outland_06a.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = { 8 | "weapon_lambda_medkit", 9 | "weapon_physcannon", 10 | "weapon_crowbar", 11 | "weapon_pistol", 12 | "weapon_shotgun", 13 | "weapon_smg1", 14 | "weapon_ar2", 15 | "weapon_357", 16 | "weapon_frag", 17 | }, 18 | Ammo = { 19 | ["SMG1"] = 45, 20 | ["Buckshot"] = 6, 21 | ["Pistol"] = 18, 22 | ["Grenade"] = 5, 23 | ["AR2"] = 50, 24 | ["357"] = 6, 25 | ["SMG1_Grenade"] = 1, 26 | }, 27 | Armor = 90, 28 | HEV = true 29 | } 30 | 31 | MAPSCRIPT.InputFilters = {} 32 | MAPSCRIPT.EntityFilterByClass = {} 33 | MAPSCRIPT.EntityFilterByName = { 34 | ["global_newgame_template_base_items"] = true, 35 | ["global_newgame_template_local_items"] = true, 36 | ["playerclip_powerroom"] = true, 37 | } 38 | 39 | MAPSCRIPT.GlobalStates = { 40 | } 41 | 42 | MAPSCRIPT.Checkpoints = { 43 | } 44 | 45 | function MAPSCRIPT:PostInit() 46 | print("-- Incomplete mapscript --") 47 | 48 | -- Power room checkpoint 49 | local cp1_powerroom = GAMEMODE:CreateCheckpoint(Vector(-3330, -9731, -1519)) 50 | ents.WaitForEntityByName("trigger_alyx_standby", function(ent) 51 | ent.OnTrigger = function(_, activator) 52 | GAMEMODE:SetPlayerCheckpoint(cp1_powerroom, activator) 53 | end 54 | end) 55 | end 56 | 57 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2/mapscripts/ep2_outland_08.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = { 8 | "weapon_lambda_medkit", 9 | "weapon_physcannon", 10 | "weapon_357", 11 | "weapon_crowbar", 12 | "weapon_frag", 13 | "weapon_pistol", 14 | "weapon_ar2", 15 | "weapon_crossbow", 16 | "weapon_smg1", 17 | "weapon_shotgun", 18 | }, 19 | Ammo = { 20 | ["Pistol"] = 18, 21 | ["XBowBolt"] = 4, 22 | ["AR2"] = 30, 23 | ["Buckshot"] = 30, 24 | ["Grenade"] = 3, 25 | ["357"] = 6, 26 | ["SMG1"] = 90, 27 | }, 28 | Armor = 45, 29 | HEV = true 30 | } 31 | 32 | MAPSCRIPT.InputFilters = {} 33 | MAPSCRIPT.EntityFilterByClass = {} 34 | MAPSCRIPT.EntityFilterByName = { 35 | ["spawnitems"] = true, 36 | ["velsensor_car_superjump_01"] = true, 37 | ["velsensor_car_superjump_00"] = true, 38 | } 39 | 40 | MAPSCRIPT.GlobalStates = { 41 | } 42 | 43 | MAPSCRIPT.Checkpoints = { 44 | } 45 | 46 | function MAPSCRIPT:PostInit() 47 | print("-- Incomplete mapscript --") 48 | 49 | -- Checkpoint before heli fight area 50 | local containerCP = GAMEMODE:CreateCheckpoint(Vector(-998, 1096, 96)) 51 | ents.WaitForEntityByName("trigger_enter_box", function(ent) 52 | ent.OnTrigger = function(_, activator) 53 | GAMEMODE:SetPlayerCheckpoint(containerCP, activator) 54 | end 55 | end) 56 | end 57 | 58 | function MAPSCRIPT:OnJalopyCreated(jalopy) 59 | local companionController = ents.Create("lambda_vehicle_companion") 60 | local name = "lambda_vc_" .. tostring(jalopy:EntIndex()) 61 | companionController:SetName(name) 62 | companionController:SetPos(jalopy:GetPos()) 63 | companionController:SetKeyValue("CompanionName", "alyx") 64 | companionController:SetParent(jalopy) 65 | companionController:Spawn() 66 | 67 | jalopy:ClearAllOutputs("PlayerOff") 68 | jalopy:ClearAllOutputs("PlayerOn") 69 | 70 | jalopy:Fire("AddOutput", "PlayerOn " .. name .. ",OnPlayerVehicleEnter,,0,-1") 71 | jalopy:Fire("AddOutput", "PlayerOff " .. name .. ",OnPlayerVehicleExit,,0,-1") 72 | end 73 | 74 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2/mapscripts/ep2_outland_10.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = { 8 | "weapon_lambda_medkit", 9 | "weapon_physcannon", 10 | "weapon_crowbar", 11 | "weapon_ar2", 12 | "weapon_crossbow", 13 | "weapon_pistol", 14 | "weapon_357", 15 | "weapon_frag", 16 | "weapon_shotgun", 17 | "weapon_smg1", 18 | }, 19 | Ammo = { 20 | ["lambda_health"] = 1, 21 | ["357"] = 6, 22 | ["AR2"] = 60, 23 | ["Grenade"] = 3, 24 | ["Buckshot"] = 18, 25 | ["Pistol"] = 18, 26 | ["XBowBolt"] = 4, 27 | ["SMG1"] = 90, 28 | }, 29 | Armor = 45, 30 | HEV = true 31 | } 32 | 33 | MAPSCRIPT.InputFilters = {} 34 | MAPSCRIPT.EntityFilterByClass = {} 35 | MAPSCRIPT.EntityFilterByName = { 36 | ["spawnitems"] = true, 37 | } 38 | 39 | MAPSCRIPT.GlobalStates = { 40 | } 41 | 42 | MAPSCRIPT.Checkpoints = { 43 | } 44 | 45 | function MAPSCRIPT:PostInit() 46 | print("-- Incomplete mapscript --") 47 | end 48 | 49 | function MAPSCRIPT:OnJalopyCreated(jalopy) 50 | local companionController = ents.Create("lambda_vehicle_companion") 51 | local name = "lambda_vc_" .. tostring(jalopy:EntIndex()) 52 | companionController:SetName(name) 53 | companionController:SetPos(jalopy:GetPos()) 54 | companionController:SetKeyValue("CompanionName", "alyx") 55 | companionController:SetParent(jalopy) 56 | companionController:Spawn() 57 | 58 | jalopy:ClearAllOutputs("PlayerOff") 59 | jalopy:ClearAllOutputs("PlayerOn") 60 | 61 | jalopy:Fire("AddOutput", "PlayerOn " .. name .. ",OnPlayerVehicleEnter,,0,-1") 62 | jalopy:Fire("AddOutput", "PlayerOff " .. name .. ",OnPlayerVehicleExit,,0,-1") 63 | end 64 | 65 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2/mapscripts/ep2_outland_10a.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = { 8 | "weapon_lambda_medkit", 9 | "weapon_pistol", 10 | "weapon_crowbar", 11 | "weapon_ar2", 12 | "weapon_crossbow", 13 | "weapon_357", 14 | "weapon_frag", 15 | "weapon_physcannon", 16 | "weapon_rpg", 17 | "weapon_shotgun", 18 | "weapon_smg1", 19 | }, 20 | Ammo = { 21 | ["AR2"] = 60, 22 | ["Buckshot"] = 18, 23 | ["Grenade"] = 3, 24 | ["SMG1"] = 90, 25 | ["SMG1_Grenade"] = 1, 26 | ["AR2AltFire"] = 1, 27 | ["RPG_Round"] = 3, 28 | ["Pistol"] = 54, 29 | ["357"] = 6, 30 | ["XBowBolt"] = 4, 31 | }, 32 | Armor = 45, 33 | HEV = true 34 | } 35 | 36 | MAPSCRIPT.InputFilters = {} 37 | MAPSCRIPT.EntityFilterByClass = {} 38 | MAPSCRIPT.EntityFilterByName = { 39 | ["spawnitems"] = true, 40 | } 41 | 42 | MAPSCRIPT.GlobalStates = { 43 | } 44 | 45 | MAPSCRIPT.Checkpoints = { 46 | } 47 | 48 | function MAPSCRIPT:PostInit() 49 | print("-- Incomplete mapscript --") 50 | end 51 | 52 | function MAPSCRIPT:OnJalopyCreated(jalopy) 53 | local companionController = ents.Create("lambda_vehicle_companion") 54 | local name = "lambda_vc_" .. tostring(jalopy:EntIndex()) 55 | companionController:SetName(name) 56 | companionController:SetPos(jalopy:GetPos()) 57 | companionController:SetKeyValue("CompanionName", "alyx") 58 | companionController:SetParent(jalopy) 59 | companionController:Spawn() 60 | 61 | jalopy:ClearAllOutputs("PlayerOff") 62 | jalopy:ClearAllOutputs("PlayerOn") 63 | 64 | jalopy:Fire("AddOutput", "PlayerOn " .. name .. ",OnPlayerVehicleEnter,,0,-1") 65 | jalopy:Fire("AddOutput", "PlayerOff " .. name .. ",OnPlayerVehicleExit,,0,-1") 66 | end 67 | 68 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2/mapscripts/ep2_outland_11b.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = { 8 | "weapon_lambda_medkit", 9 | "weapon_physcannon", 10 | "weapon_crowbar", 11 | "weapon_pistol", 12 | "weapon_shotgun", 13 | "weapon_smg1", 14 | "weapon_ar2", 15 | "weapon_crossbow", 16 | "weapon_357", 17 | }, 18 | Ammo = { 19 | ["XBowBolt"] = 5, 20 | ["AR2"] = 30, 21 | ["SMG1_Grenade"] = 3, 22 | ["Pistol"] = 20, 23 | ["SMG1"] = 45, 24 | ["Buckshot"] = 6, 25 | ["357"] = 6, 26 | }, 27 | Armor = 60, 28 | HEV = true 29 | } 30 | 31 | MAPSCRIPT.InputFilters = { 32 | ["magnusson_courtyard_exitdoor"] = {"Close"}, 33 | ["magnusson_courtyard_exitdoor_brush"] = {"Enable"}, 34 | } 35 | MAPSCRIPT.EntityFilterByClass = {} 36 | MAPSCRIPT.EntityFilterByName = { 37 | ["global_newgame_template_local_items"] = true, 38 | ["global_newgame_template_ammo"] = true, 39 | ["global_newgame_template_base_items"] = true, 40 | ["door_silo_lab_3_counter_playertrigger"] = true, -- Prevent closing the 2nd silo door 41 | ["magnusson_ragdoll_door_playerout_trigger"] = true, -- Prevent closing the door after they go out 42 | } 43 | MAPSCRIPT.GlobalStates = {} 44 | MAPSCRIPT.Checkpoints = {} 45 | 46 | function MAPSCRIPT:PostInit() 47 | print("-- Incomplete mapscript --") 48 | 49 | -- Close the first door after everyone is in 50 | -- Would leave it open but NPCs go in and out during scene 51 | ents.WaitForEntityByName("trigger_player_closedoor_1", function(ent) 52 | ent:SetKeyValue("teamwait", "1") 53 | ent:SetKeyValue("showwait", "0") 54 | end) 55 | 56 | -- Remove both triggers that close the first door 57 | for k, v in pairs(ents.FindByName("trigger_close_tvdoor_transition_1")) do 58 | v:Remove() 59 | end 60 | 61 | -- Close the first door after everyone is out 62 | local leaveTVroom = ents.Create("trigger_multiple") 63 | leaveTVroom:SetupTrigger(Vector(432, -8611, -254), Angle(0, 0, 0), Vector(-224, -269, -62), Vector(224, 269, 62)) 64 | leaveTVroom:Fire("AddOutput", "OnEndTouchAll door_silo_lab_1,Close,,0.0,-1") 65 | 66 | end 67 | 68 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/gametypes/hl2ep2/mapscripts/ep2_outland_12.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local MAPSCRIPT = {} 6 | MAPSCRIPT.DefaultLoadout = { 7 | Weapons = { 8 | "weapon_lambda_medkit", 9 | "weapon_physcannon", 10 | "weapon_rpg", 11 | "weapon_pistol", 12 | "weapon_crowbar", 13 | "weapon_ar2", 14 | "weapon_crossbow", 15 | "weapon_357", 16 | "weapon_shotgun", 17 | "weapon_smg1", 18 | }, 19 | Ammo = { 20 | ["lambda_health"] = 1, 21 | ["XBowBolt"] = 9, 22 | ["AR2"] = 60, 23 | ["SMG1_Grenade"] = 1, 24 | ["Buckshot"] = 18, 25 | ["Pistol"] = 18, 26 | ["RPG_Round"] = 3, 27 | ["357"] = 12, 28 | }, 29 | Armor = 45, 30 | HEV = true 31 | } 32 | 33 | MAPSCRIPT.InputFilters = { 34 | ["base_gate_door"] = {"Close"}, -- Dont close outside gate after battle 35 | ["changelevel_to_12a_door"] = {"Close"} -- Keep the doors into the changelevel room open 36 | } 37 | MAPSCRIPT.EntityFilterByClass = {} 38 | MAPSCRIPT.EntityFilterByName = { 39 | ["startitems"] = true, 40 | } 41 | 42 | MAPSCRIPT.GlobalStates = { 43 | } 44 | 45 | MAPSCRIPT.Checkpoints = { 46 | { 47 | Pos = Vector(-1219, -3919, -114), 48 | Ang = Angle(0, 0, 0), 49 | Trigger = { 50 | Pos = Vector(-654, -5984, -240), 51 | Mins = Vector(-285, -160, -80), 52 | Maxs = Vector(285, 160, 80) 53 | } 54 | }, 55 | } 56 | 57 | function MAPSCRIPT:PostInit() 58 | print("-- Incomplete mapscript --") 59 | 60 | -- TODO: Set checkpoints based on when and which buildings/areas get destroyed by striders 61 | -- for now, outside the base will do :) 62 | 63 | -- Simplify triggers near the changelevel 64 | for k, v in pairs(ents.FindByPos(Vector(162, -8860, -256), "trigger_multiple")) do 65 | print(k, v) 66 | if v:GetInternalVariable("filtername") == "" then 67 | print("removed") 68 | v:Remove() 69 | end 70 | end 71 | 72 | ents.WaitForEntityByName("changelevel_to_12a_counter", function(ent) 73 | ent:SetKeyValue("max", "1") 74 | end) 75 | end 76 | 77 | return MAPSCRIPT -------------------------------------------------------------------------------- /gamemode/huds/hud_armor.lua: -------------------------------------------------------------------------------- 1 | include("hud_numeric.lua") 2 | local PANEL = {} 3 | 4 | function PANEL:Init() 5 | self:SetSize(util.ScreenScaleH(103), util.ScreenScaleH(37)) 6 | self:SetLabelText(Localize("#Valve_Hud_SUIT")) 7 | self.LastArmor = 0 8 | self.AnimateValueChanged = Derma_Anim("HealthIncreased", self, self.AnimValueChanged) 9 | self.Animations = {self.AnimateValueChanged} 10 | end 11 | 12 | function PANEL:AnimValueChanged(anim, delta, data) 13 | self.Blur = (1 - delta) * 3 14 | end 15 | 16 | function PANEL:StopAnimations() 17 | for _, v in pairs(self.Animations) do 18 | v:Stop() 19 | end 20 | end 21 | 22 | function PANEL:Think() 23 | local ply = LocalPlayer() 24 | if not IsValid(ply) then return end 25 | 26 | for _, v in pairs(self.Animations) do 27 | if v:Active() then 28 | v:Run() 29 | end 30 | end 31 | 32 | local armor = ply:Armor() 33 | if armor == self.LastArmor then return end 34 | self.LastArmor = armor 35 | 36 | if armor >= 20 then 37 | self.AnimateValueChanged:Start(2) 38 | end 39 | 40 | self:SetDisplayValue(armor) 41 | end 42 | 43 | vgui.Register("HudArmor", PANEL, "HudNumeric") -------------------------------------------------------------------------------- /gamemode/huds/hud_health.lua: -------------------------------------------------------------------------------- 1 | include("hud_numeric.lua") 2 | local PANEL = {} 3 | 4 | function PANEL:Init() 5 | self:SetSize(util.ScreenScaleH(103), util.ScreenScaleH(37)) 6 | self:SetLabelText(Localize("#Valve_Hud_HEALTH")) 7 | self.LastHealth = 0 8 | self.LastArmor = 0 9 | self.AnimateHealthIncreased = Derma_Anim("HealthIncreased", self, self.AnimHealthIncreased) 10 | self.AnimateHealthDecreasedBelow20 = Derma_Anim("HealthDecreasedBelow20", self, self.AnimHealthDecreasedBelow20) 11 | self.AnimateHealthLow = Derma_Anim("HealthLow", self, self.AnimHealthLow) 12 | self.Animations = {self.AnimateHealthIncreased, self.AnimateHealthDecreasedBelow20, self.AnimateHealthLow} 13 | end 14 | 15 | function PANEL:AnimHealthIncreased(anim, delta, data) 16 | self.Blur = (1 - delta) * 3 17 | end 18 | 19 | function PANEL:AnimHealthDecreasedBelow20(anim, delta, data) 20 | self.Blur = delta * 1 21 | end 22 | 23 | function PANEL:AnimHealthLow(anim, delta, data) 24 | if delta == 1 then return self.AnimateHealthLow:Start(0.8) end 25 | local r 26 | 27 | if delta <= 0.3 then 28 | r = (delta / 0.3) * 100 29 | else 30 | delta = delta - 0.3 31 | r = (1 - (delta / 0.7)) * 100 32 | end 33 | 34 | --DbgPrint(r) 35 | self:SetTextColor(255, 0, 0, 128) 36 | self:SetBackgroundColor(r, 0, 0, 128) 37 | end 38 | 39 | function PANEL:StopAnimations() 40 | for _, v in pairs(self.Animations) do 41 | v:Stop() 42 | end 43 | end 44 | 45 | function PANEL:Think() 46 | local ply = LocalPlayer() 47 | if not IsValid(ply) then return end 48 | 49 | for _, v in pairs(self.Animations) do 50 | if v:Active() then 51 | v:Run() 52 | end 53 | end 54 | 55 | local health = math.Clamp(ply:Health(), 0, ply:GetMaxHealth()) 56 | if health == self.LastHealth then return end 57 | self.LastHealth = health 58 | 59 | if health >= 20 then 60 | self.AnimateHealthLow:Stop() 61 | self.AnimateHealthDecreasedBelow20:Stop() 62 | self.AnimateHealthIncreased:Start(3) 63 | else 64 | self.AnimateHealthIncreased:Stop() 65 | self.AnimateHealthDecreasedBelow20:Start(0.5) 66 | self.AnimateHealthLow:Start(1) 67 | end 68 | 69 | self:SetDisplayValue(health) 70 | end 71 | 72 | vgui.Register("HudHealth", PANEL, "HudNumeric") -------------------------------------------------------------------------------- /gamemode/huds/hud_lambda.lua: -------------------------------------------------------------------------------- 1 | local PANEL = {} 2 | local W = 375 3 | local H = 440 4 | PANEL.Tabs = {{"Info", "info"}, {"Vote", "poll"}, {"Player", "player_settings"}, {"Settings", "settings"}} 5 | 6 | function PANEL:Init() 7 | self:SetSkin("Lambda") 8 | self:SetSize(W, H) 9 | self:SetPos(20, ScrH() / 2 - (H / 2)) 10 | self:SetTitle("SETTINGS MENU - " .. string.upper(GAMEMODE:GetGameTypeData("Name"))) 11 | self.Sheet = self:Add("DPropertySheet") 12 | self.Sheet.RootPanel = self 13 | self.Sheet:Dock(LEFT) 14 | self.Sheet:SetSize(W - 10, H) 15 | self.TabPanels = {} 16 | 17 | for k, v in ipairs(self.Tabs) do 18 | local pnl_name = "Lambda" .. v[1] .. "Panel" 19 | local pnl_icon = "lambda/icons/" .. v[2] .. ".png" 20 | self.TabPanels[k] = self.Sheet:Add(pnl_name) 21 | self.TabPanels[k].RootPanel = self 22 | self.Sheet:AddSheet(string.upper(v[1]), self.TabPanels[k], pnl_icon) 23 | end 24 | 25 | cookie.Set("LambdaMenuOpened", 1) 26 | end 27 | 28 | function PANEL:SetTab(tab) 29 | self.Sheet:SetActiveTab(self.Sheet:GetItems()[tab].Tab) 30 | end 31 | 32 | function PANEL:OnClose() 33 | net.Start("LambdaPlayerSettings") 34 | net.WriteBool(false) 35 | net.SendToServer() 36 | end 37 | 38 | function PANEL:OnKeyCodePressed(key) 39 | if key == KEY_F1 or key == KEY_F2 or key == KEY_F3 or key == KEY_F4 then 40 | self:Close() 41 | end 42 | end 43 | 44 | function PANEL:Think() 45 | if input.IsKeyDown(KEY_ESCAPE) then 46 | self:Close() 47 | gui.HideGameUI() 48 | end 49 | end 50 | 51 | vgui.Register("HudPlayerSettings", PANEL, "DFrame") 52 | 53 | net.Receive("LambdaPlayerSettings", function(len) 54 | local state = net.ReadBool() 55 | local tab = net.ReadUInt(3) 56 | 57 | if tab > 4 then 58 | tab = 1 59 | end 60 | 61 | if LAMBDA_PLAYER_SETTINGS ~= nil then 62 | LAMBDA_PLAYER_SETTINGS:Remove() 63 | end 64 | 65 | if state == true then 66 | LAMBDA_PLAYER_SETTINGS = vgui.Create("HudPlayerSettings") 67 | LAMBDA_PLAYER_SETTINGS:MakePopup() 68 | LAMBDA_PLAYER_SETTINGS:SetSkin("Lambda") 69 | LAMBDA_PLAYER_SETTINGS:SetTab(tab) 70 | end 71 | end) 72 | 73 | function ShowSettings(tab) 74 | if LAMBDA_PLAYER_SETTINGS ~= nil then 75 | LAMBDA_PLAYER_SETTINGS:Remove() 76 | end 77 | 78 | LAMBDA_PLAYER_SETTINGS = vgui.Create("HudPlayerSettings") 79 | LAMBDA_PLAYER_SETTINGS:MakePopup() 80 | LAMBDA_PLAYER_SETTINGS:SetSkin("Lambda") 81 | LAMBDA_PLAYER_SETTINGS:SetTab(tab or 1) 82 | end -------------------------------------------------------------------------------- /gamemode/huds/hud_secondary_ammo.lua: -------------------------------------------------------------------------------- 1 | include("hud_numeric.lua") 2 | local PANEL = {} 3 | 4 | function PANEL:Init() 5 | self:SetShouldDisplaySecondaryValue(false) 6 | self:SetSize(util.ScreenScaleH(80), util.ScreenScaleH(37)) 7 | self:SetLabelText(Localize("#Valve_Hud_AMMO_ALT")) 8 | self.LastClip1 = 0 9 | self.LastClip2 = 0 10 | self.LerpValues = false 11 | self.AnimateValueChanged = Derma_Anim("AmmoChanged", self, self.AnimValueChanged) 12 | self.Animations = {self.AnimateValueChanged} 13 | end 14 | 15 | function PANEL:Reset() 16 | self.LastClip1 = 0 17 | self.LastClip2 = 0 18 | end 19 | 20 | function PANEL:AnimValueChanged(anim, delta, data) 21 | self.Blur = (1 - delta) * 3 22 | --self:SetBackgroundColor(0, 0, 0, 128) 23 | --self:SetTextColor(255, 208, 64, 255) 24 | end 25 | 26 | function PANEL:StopAnimations() 27 | for _, v in pairs(self.Animations) do 28 | v:Stop() 29 | end 30 | end 31 | 32 | function PANEL:Think() 33 | local ply = LocalPlayer() 34 | if not IsValid(ply) then return end 35 | local wep = ply:GetActiveWeapon() 36 | if not IsValid(wep) then return end 37 | 38 | for _, v in pairs(self.Animations) do 39 | if v:Active() then 40 | v:Run() 41 | end 42 | end 43 | 44 | local altAmmo = 0 45 | 46 | if wep.Ammo2 ~= nil and isfunction(wep.Ammo2) then 47 | altAmmo = wep:Ammo2() 48 | else 49 | altAmmo = ply:GetAmmoCount(wep:GetSecondaryAmmoType()) 50 | end 51 | 52 | if altAmmo ~= self.LastClip1 then 53 | self.AnimateValueChanged:Start(2) 54 | self.LastClip1 = altAmmo 55 | end 56 | 57 | self:SetDisplayValue(altAmmo) 58 | end 59 | 60 | vgui.Register("HudSecondaryAmmo", PANEL, "HudNumeric") -------------------------------------------------------------------------------- /gamemode/huds/hud_suit.lua: -------------------------------------------------------------------------------- 1 | include("hud_health.lua") 2 | include("hud_armor.lua") 3 | include("hud_ammo.lua") 4 | include("hud_aux.lua") 5 | local PANEL = {} 6 | 7 | function PANEL:Init() 8 | self:ParentToHUD() 9 | self:SetSize(ScrW(), ScrH()) 10 | local posX = 35 11 | local w, h 12 | self.HUDHealth = vgui.Create("HudHealth", self) 13 | w, h = self.HUDHealth:GetSize() 14 | self.HUDHealth:SetPos(posX, ScrH() - h - util.ScreenScaleH(10)) 15 | self.HUDAux = vgui.Create("HudAux", self) 16 | local _, h2 = self.HUDAux:GetSize() 17 | self.HUDAux:SetPos(posX, ScrH() - h - util.ScreenScaleH(10) - h2 - util.ScreenScaleH(5)) 18 | posX = posX + w + util.ScreenScaleW(10) 19 | self.HUDArmor = vgui.Create("HudArmor", self) 20 | self.HUDArmor:SetPos(posX, ScrH() - h - util.ScreenScaleH(10)) 21 | self.HUDAmmo = vgui.Create("HudAmmo", self) 22 | w, h = self.HUDAmmo:GetSize() 23 | self.HUDAmmo:SetPos(ScrW() - w - util.ScreenScaleH(35), ScrH() - h - util.ScreenScaleH(10)) 24 | end 25 | 26 | function PANEL:Think() 27 | end 28 | 29 | vgui.Register("HudSuit", PANEL, "Panel") -------------------------------------------------------------------------------- /gamemode/sh_admin_config.lua: -------------------------------------------------------------------------------- 1 | local DbgPrint = GetLogging("Admin") 2 | 3 | if SERVER then 4 | AddCSLuaFile() 5 | util.AddNetworkString("LambdaAdminSetting") 6 | 7 | function GM:ChangeAdminConfiguration(ply, token, cvar, val) 8 | if ply:IsAdmin() == false then 9 | DbgPrint("Player " .. tostring(ply) .. " attempted to change settings without the correct permissions.") 10 | 11 | return 12 | end 13 | 14 | if self:ValidateUserToken(ply, token) == false then 15 | DbgPrint("Player " .. tostring(ply) .. " attempted to change settings with invalid auth token.") 16 | 17 | return 18 | end 19 | 20 | local registeredCvar = GAMEMODE:GetSettingData(cvar) 21 | 22 | if registeredCvar.CVar == nil then 23 | DbgPrint("Attempted to access unregistered cvar: " .. tostring(cvar) .. ", player: " .. tostring(ply)) 24 | 25 | return 26 | end 27 | 28 | if registeredCvar.Type == "int" or registeredCvar.Type == "bool" or registeredCvar.Type == "float" then 29 | registeredCvar.CVar:SetInt(val) 30 | registeredCvar.Value = tonumber(val) 31 | else 32 | registeredCvar.CVar:SetString(val) 33 | registeredCvar.Value = tostring(val) 34 | end 35 | end 36 | 37 | net.Receive("LambdaAdminSetting", function(len, ply) 38 | local token = net.ReadString() 39 | local cvar = net.ReadString() 40 | local val = net.ReadString() 41 | GAMEMODE:ChangeAdminConfiguration(ply, token, cvar, val) 42 | end) 43 | else -- CLIENT 44 | function GM:ChangeAdminConfiguration(cvar, val) 45 | local ply = LocalPlayer() 46 | -- Theres no point sending data. 47 | if ply:IsAdmin() == false then return end 48 | net.Start("LambdaAdminSetting") 49 | net.WriteString(LAMBDA_PLAYER_AUTH_TOKEN) 50 | net.WriteString(cvar) 51 | net.WriteString(val) 52 | net.SendToServer() 53 | end 54 | end -------------------------------------------------------------------------------- /gamemode/sh_collisions.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | function GM:ShouldCollide(ent1, ent2) 6 | if (ent1:IsNPC() and ent2:GetClass() == "trigger_changelevel") or (ent2:IsNPC() and ent1:GetClass() == "trigger_changelevel") then return false end 7 | 8 | -- Nothing collides with blocked triggers except players. 9 | if ent1.IsLambdaTrigger ~= nil and ent1:IsLambdaTrigger() == true then 10 | if ent2:IsPlayer() == true or ent2:IsVehicle() == true then return ent1:IsBlocked() end 11 | 12 | return false 13 | elseif ent2.IsLambdaTrigger ~= nil and ent2:IsLambdaTrigger() == true then 14 | if ent1:IsPlayer() == true or ent1:IsVehicle() == true then return ent2:IsBlocked() end 15 | 16 | return false 17 | end 18 | 19 | return true 20 | end -------------------------------------------------------------------------------- /gamemode/sh_compatibility.lua: -------------------------------------------------------------------------------- 1 | AddCSLuaFile() 2 | 3 | local badAddonIds = { 4 | -- "Episode animation fixes" 5 | ["3022183926"] = true, 6 | ["1879556056"] = true, 7 | ["2576796480"] = true, 8 | ["3263204957"] = true, 9 | ["1881393042"] = true, 10 | ["1095903501"] = true, 11 | ["1890049841"] = true, 12 | -- Reserved. 13 | } 14 | 15 | local function IsBadAddon(id) 16 | return badAddonIds[id] ~= nil 17 | end 18 | 19 | local function CheckAddonCompatibility() 20 | local addons = engine.GetAddons() 21 | local badAddons = {} 22 | for _, addon in pairs(addons) do 23 | if addon.mounted and IsBadAddon(addon.wsid) then 24 | table.insert(badAddons, addon) 25 | end 26 | end 27 | if #badAddons == 0 then 28 | return 29 | end 30 | local errorInfo = "WARNING: Following addons are obsolete or cause issues:\n" 31 | for _, addon in pairs(badAddons) do 32 | errorInfo = errorInfo .. " - " .. addon.title .. " (" .. addon.wsid .. ")\n" 33 | end 34 | errorInfo = errorInfo .. "Disable them and restart the game for the best experience.\n" 35 | ErrorNoHalt(errorInfo) 36 | end 37 | 38 | CheckAddonCompatibility() 39 | -------------------------------------------------------------------------------- /gamemode/sh_globalstate.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("GlobalStates") 6 | 7 | if SERVER then 8 | -- Predefined list to capture the state on map start in order to properly reset on new rounds. 9 | local GLOBAL_STATES = {"gordon_precriminal", "antlion_allied", "suit_no_sprint", "super_phys_gun", "friendly_encounter", "gordon_invulnerable", "no_seagulls_on_jeep", "ep2_alyx_injured", "ep_alyx_darknessmode", "hunters_to_run_over"} 10 | -- GLOBAL_OFF = 0 11 | -- GLOBAL_ON = 1 12 | -- GLOBAL_DEAD = 2 13 | GM.GlobalStatesSnapshot = {} 14 | 15 | function GM:InitializeGlobalStates() 16 | DbgPrint("GM:InitializeGlobalStates") 17 | local data = {} 18 | 19 | for _, v in pairs(GLOBAL_STATES) do 20 | local state = game.GetGlobalState(v) 21 | data[v] = state 22 | end 23 | 24 | self.GlobalStatesSnapshot = data 25 | --PrintTable(data) 26 | end 27 | 28 | function GM:ResetGlobalStates(data) 29 | DbgPrint("GM:ResetGlobalStates") 30 | 31 | for k, v in pairs(self.GlobalStatesSnapshot or {}) do 32 | if v == GLOBAL_DEAD then continue end -- Don't set dead ones, no need. 33 | game.SetGlobalState(k, v) 34 | end 35 | end 36 | end -------------------------------------------------------------------------------- /gamemode/sh_gma.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | GMA = {} 6 | local GMA_MAGIC = 0x44414D47 7 | local GMA_VERSION = 3 8 | 9 | local function GetFileContent(filepath, gamepath) 10 | local f = file.Open(filepath, "rb", gamepath) 11 | if f == nil then return nil end 12 | local data = f:Read(f:Size()) 13 | f:Close() 14 | 15 | return data 16 | end 17 | 18 | local function GetFileInfo(filepath, gamepath) 19 | local f = file.Open(filepath, "rb", gamepath) 20 | if f == nil then return nil end 21 | local data = f:Read(f:Size()) 22 | 23 | local info = { 24 | CRC = util.CRC(data), 25 | Size = f:Size() 26 | } 27 | 28 | f:Close() 29 | 30 | return info 31 | end 32 | 33 | function GMA.CreatePackage(filelist, outpath) 34 | local f = file.Open(outpath, "wb", "DATA") 35 | 36 | if f == nil then 37 | print("Unable to open file: " .. outpath) 38 | 39 | return false 40 | end 41 | 42 | -- Header 43 | f:WriteLong(GMA_MAGIC) -- GMAD 44 | f:WriteByte(GMA_VERSION) 45 | -- uint64: SteamID 46 | f:WriteLong(0) 47 | f:WriteLong(0) 48 | -- uint64: Timestamp 49 | f:WriteLong(0) 50 | f:WriteLong(0) 51 | -- Unused 52 | f:WriteByte(0) 53 | -- Title 54 | f:Write("Test Title") 55 | f:WriteByte(0) 56 | -- Desc 57 | f:Write("Test Desc") 58 | f:WriteByte(0) 59 | -- Author 60 | f:Write("Author") 61 | f:WriteByte(0) 62 | -- Addon Version (4) [unused] 63 | f:WriteLong(1) 64 | local fileNum = 1 65 | 66 | for _, v in pairs(filelist) do 67 | local filepath = v[1] 68 | local gamepath = v[2] 69 | local info = GetFileInfo(filepath, gamepath) 70 | 71 | if info == nil then 72 | print("Missing file: " .. filepath .. " : " .. gamepath) 73 | 74 | return false 75 | end 76 | 77 | -- File id. 78 | f:WriteLong(fileNum) 79 | -- Path. 80 | f:Write(filepath) 81 | f:WriteByte(0) 82 | -- Size 83 | f:WriteLong(info.Size) 84 | -- Timestamp 85 | f:WriteLong(0) 86 | -- CRC 87 | f:WriteLong(info.CRC) 88 | fileNum = fileNum + 1 89 | end 90 | 91 | f:WriteLong(0) 92 | 93 | for _, v in pairs(filelist) do 94 | local filepath = v[1] 95 | local gamepath = v[2] 96 | local data = GetFileContent(filepath, gamepath) 97 | 98 | if data ~= nil then 99 | f:Write(data) 100 | else 101 | print("Unable to read file: " .. filepath .. " : " .. gamepath) 102 | 103 | return false 104 | end 105 | end 106 | 107 | f:Flush() 108 | local curData = file.Read(outpath, "DATA") 109 | f:Write(util.CRC(curData)) 110 | f:Close() 111 | 112 | return true 113 | end -------------------------------------------------------------------------------- /gamemode/sh_hudhint.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local util = util 6 | local player = player 7 | local IsValid = IsValid 8 | local table = table 9 | 10 | if SERVER then 11 | util.AddNetworkString("LambdaHudHint") 12 | 13 | function GM:AddHint(text, time, ply) 14 | ply = ply or player.GetAll() 15 | net.Start("LambdaHudHint") 16 | net.WriteString(text) 17 | net.WriteFloat(time) 18 | net.Send(ply) 19 | end 20 | else -- CLIENT 21 | function GM:AddHint(text, time) 22 | local hint = vgui.Create("lambda_hud_hint") 23 | hint:SetText(text) 24 | hint:SetTime(time) 25 | hint:SetAlpha(0) 26 | hint:AlphaTo(255, 0.7, 0.1) 27 | hint:SetPos(ScrW(), ScrH() * 0.8) 28 | hint.unique = table.insert(HINTS, hint) 29 | local y = ScrH() * 0.8 30 | 31 | for i = 0, #HINTS do 32 | local pnl = HINTS[#HINTS - i] 33 | 34 | if IsValid(pnl) then 35 | pnl:MoveTo(ScrW() - hint:GetWide() - 20, y, 0.3, 0, 0.9) 36 | y = y - (pnl:GetTall() + 8) 37 | end 38 | end 39 | end 40 | 41 | local function LocalizeWithInput(text, default) 42 | local msg = language.GetPhrase(text, default) 43 | -- Process key bindings. 44 | local i = 1 45 | while i ~= nil do 46 | local pos = string.find(msg, "%", i, true) 47 | if pos == nil then break end 48 | local endPos = string.find(msg, "%", pos + 1, true) 49 | if endPos == nil then break end 50 | local leftPart = string.sub(msg, 1, pos - 1) 51 | local rightPart = string.sub(msg, endPos + 1) 52 | local key = string.sub(msg, pos + 1, endPos - 1) 53 | local binding = input.LookupBinding(key, true) 54 | 55 | if binding ~= nil then 56 | binding = string.upper(binding) 57 | msg = leftPart .. "<" .. binding .. ">" .. rightPart 58 | i = pos + 1 59 | else 60 | i = endPos + 1 61 | end 62 | end 63 | 64 | return msg 65 | end 66 | 67 | net.Receive("LambdaHudHint", function(len) 68 | local text = net.ReadString() 69 | local time = net.ReadFloat() 70 | text = LocalizeWithInput(text, text) 71 | GAMEMODE:AddHint(text, time) 72 | end) 73 | end -------------------------------------------------------------------------------- /gamemode/sh_lambda_build.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | GM.Name = "Lambda" 6 | GM.Author = "N/A" 7 | GM.Email = "N/A" 8 | GM.Website = "https://github.com/ZehMatt/Lambda" 9 | -- Testing: 801875828 10 | -- Release: 780244493 11 | -- Values will be overwritten by the CI for automated deployment. 12 | GM.WorkshopID = "801875828" 13 | GM.WorkshopBuild = false 14 | GM.Version = "develop" 15 | GM.InternalVersion = 1 -------------------------------------------------------------------------------- /gamemode/sh_maplist.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("MapList") 6 | local table = table 7 | 8 | function GM:InitializeMapList() 9 | self.MapList = table.Copy(self:GetGameTypeData("MapList") or {}) 10 | hook.Call("LambdaInitializeMapList", GAMEMODE, self.MapList) 11 | end 12 | 13 | function GM:GetMapList() 14 | if self.MapList == nil then 15 | error("InitializeMapList not called") 16 | 17 | return {} 18 | end 19 | -- Returns copy to prevent modifications. 20 | 21 | return table.Copy(self.MapList) 22 | end 23 | 24 | function GM:GetNextMap() 25 | local mapList = self.MapList 26 | local current = self:GetCurrentMapIndex() 27 | if current + 1 > #mapList then return mapList[1] end 28 | 29 | return mapList[current + 1] 30 | end 31 | 32 | function GM:GetPreviousMap() 33 | if self.PreviousMap ~= nil then return self.PreviousMap end 34 | local mapList = self.MapList 35 | local current = self:GetCurrentMapIndex() 36 | if current - 1 < 0 then return nil end 37 | 38 | return mapList[current - 1] 39 | end 40 | 41 | function GM:GetCurrentMap() 42 | local curMap = string.lower(game.GetMap()) 43 | 44 | return curMap 45 | end 46 | 47 | function GM:GetEntryLandmark() 48 | return self.EntryLandmark 49 | end 50 | 51 | function GM:GetMapIndex(prevMap, currentMap) 52 | local mapList = self.MapList 53 | DbgPrint("Getting Map Index, Prev: " .. tostring(prevMap) .. ", Cur: " .. currentMap) 54 | local foundPrev = false 55 | local lastIndex = 0 56 | 57 | for k, v in pairs(mapList) do 58 | if foundPrev then 59 | if v == currentMap then return k end 60 | foundPrev = false 61 | end 62 | 63 | if v == currentMap then 64 | lastIndex = k -- In case there was a huge jump due a manual changelevel by user. 65 | end 66 | 67 | if v == prevMap then 68 | foundPrev = true 69 | elseif prevMap == nil and v == currentMap then 70 | return k 71 | end 72 | end 73 | 74 | return lastIndex 75 | end 76 | 77 | function GM:GetCurrentMapIndex() 78 | local curMap = self:GetCurrentMap() 79 | local index = self:GetMapIndex(self.PreviousMap, curMap) 80 | DbgPrint("GetCurrentMapIndex: " .. tostring(index)) 81 | 82 | return index 83 | end -------------------------------------------------------------------------------- /gamemode/sh_playermodels.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local DbgPrint = GetLogging("Player") 6 | 7 | if SERVER then 8 | util.AddNetworkString("LambdaPlayerModels") 9 | 10 | function GM:InitializePlayerModels() 11 | local mdls = player_manager.AllValidModels() 12 | self.AvailablePlayerModels = mdls 13 | end 14 | 15 | function GM:SendPlayerModelList(ply) 16 | if self.AvailablePlayerModels == nil then 17 | error("GM:InitializePlayerModels was never called") 18 | end 19 | 20 | net.Start("LambdaPlayerModels") 21 | net.WriteTable(self.AvailablePlayerModels) 22 | net.Send(ply) 23 | DbgPrint("Sending player model list to: " .. tostring(ply)) 24 | end 25 | else -- CLIENT 26 | function GM:SetPlayerModelList(mdls) 27 | self.AvailablePlayerModels = mdls 28 | end 29 | 30 | net.Receive("LambdaPlayerModels", function(len) 31 | local mdls = net.ReadTable() 32 | GAMEMODE:SetPlayerModelList(mdls) 33 | DbgPrint("Received player model list") 34 | end) 35 | --PrintTable(mdls) 36 | end 37 | 38 | function GM:GetAvailablePlayerModels() 39 | if SERVER and self.AvailablePlayerModels == nil then 40 | error("GM:InitializePlayerModels was never called") 41 | end 42 | 43 | return self.AvailablePlayerModels 44 | end -------------------------------------------------------------------------------- /gamemode/sh_sound_env.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | sound.Add({ 6 | name = "Flesh.BulletImpact", 7 | channel = CHAN_WEAPON, 8 | volume = 0.7, 9 | level = SNDLVL_NORM, 10 | pitch = 100, 11 | sound = {"lambda/physics/flesh/flesh_impact_bullet1.wav", "lambda/physics/flesh/flesh_impact_bullet2.wav", "lambda/physics/flesh/flesh_impact_bullet3.wav", "lambda/physics/flesh/flesh_impact_bullet4.wav", "lambda/physics/flesh/flesh_impact_bullet5.wav"} 12 | }) 13 | 14 | function GM:SetSoundSuppressed(suppress) 15 | self.SuppressSound = suppress 16 | end 17 | 18 | local host_timescale = GetConVar("host_timescale") 19 | 20 | function GM:EntityEmitSound(data) 21 | local modifyPitch = true 22 | local modified 23 | 24 | if data.SoundName == "lambda/roundover.mp3" then 25 | modifyPitch = false 26 | end 27 | 28 | if modifyPitch == true then 29 | local p = data.Pitch 30 | 31 | if game.GetTimeScale() ~= 1 then 32 | p = p * (game.GetTimeScale() * 1.5) 33 | modified = true 34 | elseif host_timescale:GetFloat() ~= 1 then 35 | p = p * (host_timescale:GetFloat() * 1.5) 36 | modified = true 37 | end 38 | 39 | p = math.Clamp(p, 0, 255) 40 | data.Pitch = p 41 | end 42 | 43 | local ent = data.Entity 44 | if IsValid(ent) and ent:IsNPC() and string.sub(data.SoundName, 1, 16):iequals("player/footsteps") and self:NPCFootstep(ent, data) == false then return false end 45 | 46 | return modified 47 | end -------------------------------------------------------------------------------- /gamemode/sh_string_extend.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | function string.iequals(a, b) 6 | if string.len(a) ~= string.len(b) then return false end 7 | 8 | return string.lower(a) == string.lower(b) 9 | end -------------------------------------------------------------------------------- /gamemode/sh_temp.lua: -------------------------------------------------------------------------------- 1 | -- Before this issue is not resolved, we have to do this. 2 | -- https://github.com/Facepunch/garrysmod-issues/issues/2657 3 | if SERVER then 4 | AddCSLuaFile() 5 | end 6 | 7 | local ENTITY = FindMetaTable("Entity") 8 | local PVS_DIST = 9000 9 | local PVS_MINS = Vector(-PVS_DIST, -PVS_DIST, -PVS_DIST) 10 | local PVS_MAXS = Vector(PVS_DIST, PVS_DIST, PVS_DIST) 11 | 12 | if ENTITY.TestPVS == nil then 13 | function ENTITY:TestPVS(test) 14 | if IsEntity(test) then 15 | test = test:GetPos() 16 | end 17 | 18 | local pos = self:GetPos() 19 | if pos:Distance(test) > PVS_DIST then return false end 20 | 21 | return true 22 | end 23 | end 24 | 25 | --if ents.FindInPVS == nil then 26 | function ents.FindInPVS(what) 27 | if IsEntity(what) then 28 | what = what:GetPos() 29 | end 30 | 31 | return ents.FindInBox(what + PVS_MINS, what + PVS_MAXS) 32 | end 33 | --end -------------------------------------------------------------------------------- /gamemode/sh_userauth.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | util.AddNetworkString("LambdaPlayerToken") 4 | end 5 | 6 | local DbgPrint = GetLogging("Auth") 7 | 8 | if SERVER then 9 | local TOKEN_TABLE = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "!", "%", "~", "*", "+", "/"} 10 | local TOKEN_LEN = 24 11 | 12 | local function GenerateToken() 13 | local tokens = {} 14 | local seed = math.Round(os.time()) 15 | math.randomseed(seed) 16 | local tokenTableLen = #TOKEN_TABLE 17 | 18 | for i = 1, TOKEN_LEN do 19 | local choice = math.random(1, tokenTableLen) 20 | table.insert(tokens, TOKEN_TABLE[choice]) 21 | end 22 | 23 | return table.concat(tokens) 24 | end 25 | 26 | function GM:AssignPlayerAuthToken(ply) 27 | ply.LambdaAuthToken = GenerateToken() 28 | net.Start("LambdaPlayerToken") 29 | net.WriteString(ply.LambdaAuthToken) 30 | net.Send(ply) 31 | end 32 | 33 | function GM:ValidateUserToken(ply, token) 34 | return ply.LambdaAuthToken == token 35 | end 36 | else 37 | -- Don't set this on the player as we may receive this message before the player is created. 38 | LAMBDA_PLAYER_AUTH_TOKEN = LAMBDA_PLAYER_AUTH_TOKEN or "" 39 | 40 | net.Receive("LambdaPlayerToken", function(len) 41 | local token = net.ReadString() 42 | LAMBDA_PLAYER_AUTH_TOKEN = token 43 | DbgPrint("Received Auth Token: " .. token) 44 | end) 45 | end -------------------------------------------------------------------------------- /gamemode/sh_weapon_extend.lua: -------------------------------------------------------------------------------- 1 | if SERVER then 2 | AddCSLuaFile() 3 | end 4 | 5 | local WEAPON_META = FindMetaTable("Weapon") 6 | 7 | -- Stub function 8 | function WEAPON_META:CanHolster() 9 | return true 10 | end -------------------------------------------------------------------------------- /gamemode/sv_resource.lua: -------------------------------------------------------------------------------- 1 | local DbgPrint = GetLogging("Resource") 2 | 3 | function GM:InitializeResources() 4 | if self.WorkshopBuild == false then 5 | self:AddResourceDir("models") 6 | self:AddResourceDir("materials") 7 | self:AddResourceDir("sound") 8 | else 9 | resource.AddWorkshop(self.WorkshopID) 10 | end 11 | end 12 | 13 | function GM:AddResourceDir(dir) 14 | local resourceDir = "lambda/content" 15 | local foundDir = false 16 | local files, folders = file.Find("gamemodes/" .. resourceDir .. "/" .. dir .. "/*", "GAME") 17 | 18 | for k, v in pairs(files) do 19 | local f = dir .. "/" .. v 20 | DbgPrint("Added: " .. f) 21 | resource.AddFile(f) 22 | end 23 | 24 | for k, v in pairs(folders) do 25 | local f = dir .. "/" .. v 26 | 27 | if file.IsDir(resourceDir .. "/" .. f, "LUA") then 28 | foundDir = true 29 | self:AddResourceDir(f) 30 | end 31 | end 32 | 33 | if not foundDir then 34 | DbgPrint("Directory " .. dir .. " was added successfully") 35 | end 36 | end -------------------------------------------------------------------------------- /gamemode/sv_votefuncs.lua: -------------------------------------------------------------------------------- 1 | local voteinfo = {} 2 | voteinfo.voting = false 3 | voteinfo.rtv = false 4 | voteinfo.map = false 5 | voteinfo.ply = false 6 | voteinfo.time = 20 7 | 8 | function GM:StartSkipMapVote(issuer) 9 | local function OnSkipToNextMapResult(vote, success, timeout, option) 10 | -- Yes 11 | if success == true and option == 1 then 12 | GAMEMODE:ChangeToNextLevel() 13 | end 14 | end 15 | 16 | local nextMap = self:GetNextMap() 17 | 18 | self:StartVote(issuer, VOTE_TYPE_SKIP_MAP, 15, { 19 | NextMap = nextMap 20 | }, {"Yes", "No"}, {}, OnSkipToNextMapResult) 21 | end 22 | 23 | function GM:StartRestartMapVote(issuer) 24 | local function OnRestartMapVoteResult(vote, success, timeout, option) 25 | -- Yes 26 | if success == true and option == 1 then 27 | GAMEMODE:CleanUpMap() 28 | end 29 | end 30 | 31 | self:StartVote(issuer, VOTE_TYPE_RESTART_MAP, 15, {}, {"Yes", "No"}, {}, OnRestartMapVoteResult) 32 | end 33 | 34 | function GM:StartMapVote(issuer, map) 35 | local function OnChangeLevelVoteResult(vote, success, timeout, option) 36 | -- Yes 37 | if success == true and option == 1 then 38 | GAMEMODE:RequestChangeLevel(map, nil, {}) 39 | end 40 | end 41 | 42 | if string.lower(map) == string.lower(game.GetMap()) then return end 43 | 44 | self:StartVote(issuer, VOTE_TYPE_CHANGE_MAP, 15, { 45 | Map = map 46 | }, {"Yes", "No"}, {}, OnChangeLevelVoteResult) 47 | end 48 | 49 | function GM:StartKickVote(issuer, id) 50 | local ply = Player(id) 51 | if not IsValid(ply) then return end 52 | 53 | local function OnKickPlayerVoteResult(vote, success, timeout, option) 54 | -- Yes 55 | if success == true and option == 1 then 56 | game.KickID(id, "You have been vote kicked.") 57 | end 58 | end 59 | 60 | self:StartVote(issuer, VOTE_TYPE_KICK_PLAYER, 15, { 61 | Player = ply 62 | }, {"Yes", "No"}, {ply}, OnKickPlayerVoteResult) 63 | end -------------------------------------------------------------------------------- /gamemode/sv_weapontracking.lua: -------------------------------------------------------------------------------- 1 | local CurTime = CurTime 2 | local IsValid = IsValid 3 | 4 | function GM:InitializeWeaponTracking() 5 | self.TrackedWeapons = {} 6 | self.NextWeaponCheck = CurTime() + 0.1 7 | end 8 | 9 | function GM:TrackWeapon(wep) 10 | table.insert(self.TrackedWeapons, wep) 11 | end 12 | 13 | function GM:WeaponTrackingThink() 14 | local curTime = CurTime() 15 | if self.NextWeaponCheck == nil or self.NextWeaponCheck < curTime then return end 16 | local ownerlessCount = 0 17 | 18 | for k = #self.TrackedWeapons, 1, -1 do 19 | local wep = self.TrackedWeapons[k] 20 | 21 | if not IsValid(wep) then 22 | table.remove(self.TrackedWeapons, k) 23 | continue 24 | end 25 | 26 | if wep:GetOwner() == nil or wep:GetOwner() == NULL and self:IsLevelDesignerPlacedObject(wep) == false then 27 | if ownerlessCount >= 200 then 28 | PrintMessage(HUD_PRINTTALK, "Removing weapon: " .. tostring(wep)) 29 | table.remove(self.TrackedWeapons, k) 30 | wep:Remove() 31 | continue 32 | else 33 | ownerlessCount = ownerlessCount + 1 34 | end 35 | end 36 | end 37 | 38 | self.NextWeaponCheck = curTime + 0.1 39 | end -------------------------------------------------------------------------------- /icon24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/icon24.png -------------------------------------------------------------------------------- /lambda.txt: -------------------------------------------------------------------------------- 1 | "lambda" 2 | { 3 | "base" "base" 4 | "title" "Lambda" 5 | "maps" "d1_trainstation_01|d1_trainstation_02|d1_trainstation_03|d1_trainstation_04|d1_trainstation_05|d1_trainstation_06|d1_canals_01|d1_canals_01a|d1_canals_02|d1_canals_03|d1_canals_05|d1_canals_06|d1_canals_07|d1_canals_08|d1_canals_09|d1_canals_10|d1_canals_11|d1_canals_12|d1_canals_13|d1_eli_01|d1_eli_02|d1_town_01|d1_town_01a|d1_town_02|d1_town_02a|d1_town_03|d1_town_04|d1_town_05|d2_coast_01|d2_coast_03|d2_coast_04|d2_coast_05|d2_coast_07|d2_coast_08|d2_coast_09|d2_coast_10|d2_coast_11|d2_coast_12|d2_prison_01|d2_prison_02|d2_prison_03|d2_prison_04|d2_prison_05|d2_prison_06|d2_prison_07|d2_prison_08|d3_c17_01|d3_c17_02|d3_c17_03|d3_c17_04|d3_c17_05|d3_c17_06a|d3_c17_06b|d3_c17_07|d3_c17_08|d3_c17_09|d3_c17_10a|d3_c17_10b|d3_c17_11|d3_c17_12|d3_c17_12b|d3_c17_13|d3_citadel_01|d3_citadel_02|d3_citadel_03|d3_citadel_04|d3_citadel_05|d3_breen_01" 6 | "category" "pve" 7 | "menusystem" "1" 8 | 9 | "settings" 10 | { 11 | 1 12 | { 13 | "name" "lambda_player_god" 14 | "text" "Godmode" 15 | "help" "Enables Godmode" 16 | "type" "CheckBox" 17 | "default" "0" 18 | } 19 | 20 | 2 21 | { 22 | "name" "lambda_playercollision" 23 | "text" "Player collision" 24 | "help" "Disables or enables player collision" 25 | "type" "CheckBox" 26 | "default" "1" 27 | } 28 | 29 | 3 30 | { 31 | "name" "lambda_friendlyfire" 32 | "text" "Friendly fire" 33 | "help" "Disables or enables friendly fire" 34 | "type" "CheckBox" 35 | "default" "1" 36 | } 37 | 38 | 4 39 | { 40 | "name" "lambda_max_respawn_timeout" 41 | "text" "Respawn time" 42 | "help" "How long does it take to respawn(in seconds)" 43 | "type" "Numeric" 44 | "default" "20" 45 | } 46 | 47 | 5 48 | { 49 | "name" "lambda_max_restart_timeout" 50 | "text" "Restart time" 51 | "help" "How long does it take for the round to restart(in seconds)" 52 | "type" "Numeric" 53 | "default" "20" 54 | } 55 | 56 | 6 57 | { 58 | "name" "lambda_map_change_timeout" 59 | "text" "Mapchange time" 60 | "help" "How long does it take to start a round after mapchange(in seconds)" 61 | "type" "Numeric" 62 | "default" "60" 63 | } 64 | 65 | 7 66 | { 67 | "name" "lambda_connect_timeout" 68 | "text" "Connect timeout" 69 | "help" "How long before the connection is timedout(in seconds)" 70 | "type" "Numeric" 71 | "default" "120" 72 | } 73 | 74 | 8 75 | { 76 | "name" "lambda_checkpoint_timeout" 77 | "text" "Checkpoint timeout" 78 | "help" "How long before people are moved to current waiting checkpoint (0 is disabled)" 79 | "type" "Numeric" 80 | "default" "60" 81 | } 82 | 83 | 9 84 | { 85 | "name" "lambda_gametype" 86 | "text" "Gametype" 87 | "help" "Controls the behavior of the game" 88 | "type" "Text" 89 | "default" "auto" 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMLambda/Lambda/d933bda07a3ff43695fc90adc64ccbff6b4e2f24/logo.png --------------------------------------------------------------------------------