-
Notifications
You must be signed in to change notification settings - Fork 78
Add new map "GridWar" by mpixel #337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mpixelate
wants to merge
7
commits into
MT-CTF:master
Choose a base branch
from
mpixelate:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
551f4d2
Add GridWar map
mpixelate 0ee8c96
Remove glasses and ladders from initial stuff
mpixelate d122264
Add torches to initial stuff
mpixelate 058d7e2
Merge branch 'MT-CTF:master' into master
mpixelate 49bce79
Merge branch 'MT-CTF:master' into master
mpixelate b89e3b7
Update GridWar by mpixel
mpixelate ccc979a
Update init.lua
mpixelate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| local MAP_NAME = "GridWar" | ||
| local DEATH_BARRIER_Y_OFFSET = 12 | ||
| local RESPAWN_Y_OFFSET = 2 | ||
| local AIR_LIGHT_LEVEL = 3 | ||
| local MESSAGE_INTERVAL = 600 | ||
|
|
||
|
|
||
| local gridwar_messages = { | ||
| "You can never reach the ground", | ||
| "Headache?", | ||
| "I feel I am in heaven", | ||
| "Don't confuse direction", | ||
| "Am I in heaven?", | ||
| "The void calls to you", | ||
| "Reality bends around you", | ||
| "Which way is up?", | ||
| "Gravity is just a suggestion", | ||
| "Lost in the grid...", | ||
| "The platform knows your thoughts", | ||
| "Time moves differently here", | ||
| "Are you still falling?", | ||
| "The lights whisper secrets", | ||
| "Nothing is as it seems", | ||
| "Welcome to the endless maze", | ||
| "The grid remembers everything", | ||
| "Footsteps echo in eternity", | ||
| "Your shadow has left you", | ||
| "The air tastes of electricity", | ||
| "Distance is an illusion", | ||
| "Something watches from below", | ||
| "The patterns repeat forever", | ||
| "Can you trust your eyes?", | ||
| "The platform shifts when you sleep", | ||
| "Echoes of forgotten battles", | ||
| "The void has infinite patience", | ||
| "Your reflection lies to you", | ||
| "The grid dreams of escape", | ||
| "Falling upward is still falling", | ||
| "The silence is deafening", | ||
| "I don't feel gravity", | ||
| "In a dream", | ||
| "I feel light" | ||
| } | ||
|
|
||
| local message_timer = nil | ||
|
|
||
| local function send_atmospheric_message() | ||
| if not ctf_map.current_map or ctf_map.current_map.name ~= MAP_NAME then | ||
| return | ||
| end | ||
|
|
||
| local message = gridwar_messages[math.random(#gridwar_messages)] | ||
|
|
||
| minetest.chat_send_all(minetest.colorize("#FFAA00", "◊ " .. message .. " ◊")) | ||
| end | ||
|
|
||
| minetest.register_node("ctf_map:glowing_air", { | ||
| description = "Glowing Air", | ||
| drawtype = "airlike", | ||
| paramtype = "light", | ||
| light_source = AIR_LIGHT_LEVEL, | ||
| walkable = false, | ||
| pointable = false, | ||
| diggable = false, | ||
| buildable_to = true, | ||
| air_equivalent = true, | ||
| drop = "", | ||
| groups = {not_in_creative_inventory = 1} | ||
| }) | ||
|
|
||
|
|
||
| local world_bound_pos1, world_bound_pos2 = nil, nil | ||
| ctf_api.register_on_new_match(function () | ||
| if ctf_map.current_map and ctf_map.current_map.name == MAP_NAME then | ||
| minetest.after(0, function () | ||
| world_bound_pos1 = ctf_map.current_map.pos1 | ||
| world_bound_pos2 = ctf_map.current_map.pos2 | ||
| end) | ||
|
|
||
| local function schedule_next_message() | ||
| if ctf_map.current_map and ctf_map.current_map.name == MAP_NAME then | ||
| send_atmospheric_message() | ||
| message_timer = minetest.after(MESSAGE_INTERVAL, schedule_next_message) | ||
| end | ||
| end | ||
| message_timer = minetest.after(120, schedule_next_message) | ||
| end | ||
| end) | ||
|
|
||
| ctf_api.register_on_match_end(function () | ||
| if ctf_map.current_map and ctf_map.current_map.name == MAP_NAME then | ||
| world_bound_pos1 = nil | ||
| world_bound_pos2 = nil | ||
|
|
||
| if message_timer then | ||
| message_timer:cancel() | ||
| message_timer = nil | ||
| end | ||
| end | ||
| end) | ||
|
|
||
| minetest.register_on_player_hpchange(function(player, hp_change, reason) | ||
| if reason and reason.type == "fall" then | ||
| if ctf_map.current_map and ctf_map.current_map.name == MAP_NAME then | ||
| return 0 | ||
| end | ||
| end | ||
| return hp_change | ||
| end, true) | ||
|
|
||
| -- teleport barriers | ||
|
|
||
| local function is_below_death_barrier(player) | ||
| if not world_bound_pos1 then return false end | ||
| return player:get_pos().y < world_bound_pos1.y + DEATH_BARRIER_Y_OFFSET | ||
| end | ||
|
|
||
| local function respawn_player_at_top(player) | ||
| if not world_bound_pos2 then return end | ||
| local pos = player:get_pos() | ||
| local new_pos = {x = pos.x, y = world_bound_pos2.y - RESPAWN_Y_OFFSET, z = pos.z} | ||
| player:set_pos(new_pos) | ||
| end | ||
|
|
||
| minetest.register_globalstep(function () | ||
| if ctf_map.current_map and ctf_map.current_map.name ~= MAP_NAME then | ||
| return | ||
| end | ||
| for _, player in ipairs(minetest:get_connected_players()) do | ||
| if is_below_death_barrier(player) then | ||
| respawn_player_at_top(player) | ||
| end | ||
| end | ||
| end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| game_modes = return {"classes","nade_fight","classic"} | ||
| barrier_area = return {pos1={z=0,x=0,y=0},pos2={z=222,x=222,y=60}} | ||
| teams = local _={};_[1]="flag_pos";_[2]="enabled";return {purple={[_[2]]=true,[_[1]]={z=207,x=207,y=31},pos1={z=222,x=222,y=0},pos2={z=111,x=111,y=60}},blue={[_[2]]=true,[_[1]]={z=207,x=15,y=31},pos1={z=222,x=0,y=0},pos2={z=111,x=111,y=60}},green={[_[2]]=true,[_[1]]={z=15,x=15,y=31},pos1={z=0,x=0,y=0},pos2={z=111,x=111,y=60}},orange={[_[2]]=true,[_[1]]={z=15,x=207,y=31},pos1={z=0,x=222,y=0},pos2={z=111,x=111,y=60}}} | ||
| chests = return {{amount=100,pos1={z=114,x=6,y=13},pos2={z=216,x=108,y=55}},{amount=100,pos1={z=6,x=6,y=13},pos2={z=108,x=108,y=55}},{amount=100,pos1={z=6,x=114,y=13},pos2={z=108,x=216,y=55}},{amount=100,pos1={z=114,x=114,y=13},pos2={z=216,x=216,y=55}}} | ||
| phys_jump = 1 | ||
| phys_speed = 1 | ||
| size = return {z=222,x=222,y=60} | ||
| map_version = 3 | ||
| enabled = true | ||
| name = GridWar | ||
| phys_gravity = 1 | ||
| initial_stuff = return {"default:pick_stone","ctf_ranged:pistol_loaded","default:stick 5","default:cobble 99"} | ||
| author = mpixel | ||
| hint = | ||
| license = CC BY-SA 4.0 | ||
| others = | ||
| treasures = default:stone_with_mese;1;3;1;0.15;1;default:stone_with_iron;1;5;1;0.2;1;default:glass;50;99;2;0.3;1; | ||
| skybox = none | ||
| enable_shadows = 0.26 | ||
| start_time = 0 | ||
| time_speed = 1 | ||
|
|
||
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.