NOTE: I took most of the code for neutral intels from Lorgan's special delivery mod, I hope he doesn't mindThis is rocketjump basketball, best played with teams of 1-3.
- grab the "red" intel in the middle and dunk it into the opponent's basket
- killing the intel carrier will automatically give you the intel
^ use this map for hostingif for some reason you want to make a custom map, here's how it works:
- red intel is exposed
- blu intel is in the ground somewhere, preferrably near the red intel and in plain view
- place capture zones where you want the baskets to be
- use team-colored intel walls to prevent players from dunking into the wrong basket
- optional: use player walls and move boxes to prevent players from capping from the sides and bottom of the basket
Versions: should work for any version as long as intel grab syncing doesn't change dramatically
Conflicts: Special Delivery, since the plugin recognizes a bball map by the same criteria (intel and capture zones). If there's a way to avoid this, please let me know
//ghetto modded to work for bball by chu, built off of
// Lorgan's special delivery game mode server plugin!
// Vanilla compatible!
global.bball = true;
//patching the inteligence stuff to work for special delivery
object_event_add(IntelligenceRed,ev_create,0,"
delivered = true;
first = false;
");
object_event_add(IntelligenceRed,ev_alarm,0,"delivered = true;");
object_event_add(IntelligenceBlue,ev_alarm,0,"
if global.isHost && global.bball {
doEventReturnIntel(TEAM_RED);
sendEventReturnIntel(TEAM_RED);
with(Intelligence) delivered = true;
}
");
//changing the collision code because that has to work completely different
object_event_clear(Character,ev_collision,IntelligenceRed);
object_event_add(Character,ev_collision,IntelligenceRed,"
// Intelligence grabbing is synced now, so it's only tested on the server
if(global.isHost and !global.mapchanging) {
if !global.bball {
if(team == TEAM_BLUE and !place_meeting(x,y,TeamGate) and canGrabIntel == 1 and ubered == 0 and !cloak) {
sendEventGrabIntel(player);
doEventGrabIntel(player);
}
} else if (other.delivered and canGrabIntel == 1 and ubered == 0 and !cloak) {
if player.team == TEAM_BLUE {
sendEventGrabIntel(player);
doEventGrabIntel(player);
} else if other.alarm[0] < 0 {
other.delivered = false;
sendEventGrabIntel(player);
doEventGrabIntel(player);
}
}
}
");
object_event_clear(Character,ev_collision,IntelligenceBaseRed);
object_event_add(Character,ev_collision,IntelligenceBaseRed,"
if(global.isHost) {
if(team == TEAM_RED and intel == true) && !global.bball {
sendEventScoreIntel(player);
doEventScoreIntel(player);
GameServer.syncTimer = 1;
}
}
");
object_event_clear(Character,ev_collision,IntelligenceBlue);
object_event_add(Character,ev_collision,IntelligenceBlue,"
// Intelligence grabbing is synced now, so it's only tested on the server
if(global.isHost and !global.mapchanging) {
if other.alarm[0] < 0 && global.bball exit;
if(team == TEAM_RED and !place_meeting(x,y,TeamGate) and canGrabIntel == 1 and ubered == 0 and !cloak) {
sendEventGrabIntel(player);
doEventGrabIntel(player);
}
}
");
object_event_clear(Character,ev_collision,IntelligenceBaseBlue);
object_event_add(Character,ev_collision,IntelligenceBaseBlue,"
if(global.isHost) {
if(team == TEAM_BLUE and intel == true) && !global.bball {
sendEventScoreIntel(player);
doEventScoreIntel(player);
GameServer.syncTimer = 1;
}
}
");
//shorten the drop time because else it would be too hard to defend the ball
object_event_clear(Character,ev_other,ev_user5);
object_event_add(Character,ev_other,ev_user5,"
if intel == true {
sound_play(IntelDropSnd);
intel=false;
canGrabIntel=false;
alarm[1]=150;
animationOffset=CHARACTER_ANIMATION_NORMAL;
var isMe;
isMe = (global.myself == player);
recordEventInLog(5, player.team, player.name, isMe);
if(team == TEAM_RED) {
newIntel = instance_create(x,y,IntelligenceBlue);
} else if (team == TEAM_BLUE){
newIntel = instance_create(x,y,IntelligenceRed);
}
newIntel.alarm[0] = 90;
}
");
object_event_add(Character,ev_destroy,0,"
if intel && global.isHost && global.bball {
with(Intelligence) {
if alarm[0] >= 90 alarm[0] = 90;
}
var resetTeam;
if team == TEAM_RED resetTeam = TEAM_BLUE;
else resetTeam = TEAM_RED;
doEventReturnIntel(resetTeam);
sendEventReturnIntel(resetTeam);
with(Intelligence) delivered = true;
if(instance_exists(lastDamageDealer)) {
if(lastDamageDealer.object != -1) {
sendEventGrabIntel(lastDamageDealer);
doEventGrabIntel(lastDamageDealer);
with(Intelligence) delivered = false;
}
}
}
");
//the scorepanel does basically everything for the game mode to work
object_event_add(ScorePanel,ev_create,0,"
if instance_exists(CaptureZone) && global.isHost {
global.caplimit = 10;
global.bball = true;
global.sd_first = true;
with(IntelligenceRed) {
alarm[0] = 10;
delivered = false;
first = true;
}
GameServer.syncTimer = 1;
} else {
global.bball = false;
global.caplimit = global.caplimitBkup;
}
silentTimer = 0;
");
object_event_add(ScorePanel,ev_step,ev_step_begin,"
if global.bball && global.winners == -1 {
if instance_exists(IntelligenceRed) {
if IntelligenceRed.first {
if IntelligenceRed.delivered {
IntelligenceRed.first = false;
ServerMessageString('Go!',global.eventBuffer);
with NoticeO instance_destroy();
notice = instance_create(0, 0, NoticeO);
notice.notice = NOTICE_CUSTOM;
notice.message = 'Go!';
}
}
}
var redOnPoint, blueOnPoint, capper;
redOnPoint = false;
blueOnPoint = false;
capper = noone;
with(Character) {
if cappingPoint != noone {
//is someone capping?
if intel capper = player.team;
if capper == TEAM_RED {
global.redCaps += 1;
GameServer.syncTimer = 1;
//event_user(5);
hp = 0;
} else if capper == TEAM_BLUE {
global.blueCaps += 1;
GameServer.syncTimer = 1;
//event_user(5);
hp = 0;
}
}
}
}
");
//for capturing the "platform"
object_event_clear(CaptureZone,ev_create,0);
object_event_add(CaptureZone,ev_create,0,"
if(instance_exists(ArenaControlPoint)) {
cp = ArenaControlPoint.id;
} else if instance_exists(ControlPoint) {
cp = instance_nearest(x,y,ControlPoint);
} else cp = 9999;
");