Skip to content

Instantly share code, notes, and snippets.

View ZaSpai's full-sized avatar
🩺
AUS // FE Engage / (TinyWars) / (Custom Street) / (GG2)

ZaSpai ZaSpai

🩺
AUS // FE Engage / (TinyWars) / (Custom Street) / (GG2)
View GitHub Profile
//Perform delete of QC Weapon
//argument0: weapon ID
var wepDel;
wepDel = ds_list_find_value(global.qcWeps, wepID);
with (wepDel) {
instance_destroy();
}
ds_list_delete(global.qcWeps, ds_list_find_index(global.qcWeps, wepDel));
//Server command to inform all clients of a deleted QCWep object
//argument0: weapon ID
global.qcWepBuffer = buffer_create();
write_ubyte(global.qcWepBuffer, QCWEP_DELETE);
write_ubyte(global.qcWepBuffer, argument0);
PluginPacketSend(zsQC, global.qcWepBuffer, false);
@ZaSpai
ZaSpai / QCWepPlugin.gml
Last active August 29, 2015 14:01
Tentative page for QC Wep Plugin until I decide to split things off into separate pages for Weapons/Bullets and Pickups/Networking. Refer to other pages
//argument0 and argument1 definitions
globalvar QCResource, zsQC;
QCResource = directory;
zsQC = packetID;
//initialize the plugin options
ini_open("gg2.ini");
global.inputDropWep = ini_read_real("Plugins","qcwep_drop",ord('G'));
@ZaSpai
ZaSpai / sendEventCreateQCWep.gml
Last active August 29, 2015 14:01
Sends buffer data for a QC equippable weapon upon Character Death or keypress DROP_WEAPON
//Initializes and sends the parameters for a QC equippable weapon upon Character Death or keypress DROP_WEAPON
//argument0: class of the dead character, or weapon subtype
//argument1: the irandom(20)
//argument2: owner x
//argument3: owner y
global.qcWepBuffer = buffer_create();
write_ubyte(global.qcWepBuffer, QCWEP_CREATE);
write_ubyte(global.qcWepBuffer, argument0 + 1);
@ZaSpai
ZaSpai / doEventCreateQCWep.gml
Last active August 29, 2015 14:01
Creates a QC equippable weapon upon Character Death or keypress DROP_WEAPON, as sent by SendEventCreateQCWep
//Performs the Create Weapon for a pickup
//argument0: class of the dead character, or weapon subtype
//argument1: the irandom(20)
//argument2: owner x
//argument3: owner y
var wep;
instance_create(argument2,argument3 - 8,global.QCWep);
wep.direction = 80 + argument2;
wep.speed = 7;
@ZaSpai
ZaSpai / recordWepChangeInLog.gml
Last active August 29, 2015 14:01
Display a QC weapon change in the log (WIP)
// Record QC weapon change in log
// argument0: Class parameter of pickup item
// argument1: The team
// argument2: The player name
// argument3: Am I involved?
var weapon, sprite, icon, name, description;
weapon = "";
sprite = -1;
icon = "";
name = string_copy(argument2.name, 1, 20);
//combined RTD and Killstreak+BUFFS by Rumrusher/ZaSpai
//designed with partial Upgradeable Sentries (BassMakesPaste) compatibility
//original killstreak plugin by Lorgan (original idea by Vindicator)
//original rtd plugin by Lorgan
//edits the following: Sentry creation, begin and end steps, Sentry and N+B HUDs, numerous Character events, StabMask collision with Sentry and Character. Adds alarm[8] to Sentry and Character
//uses global.SerializeBuffer to sync new data. WILL CAUSE A HANG AND CRASH if you forget to take this plugin out when you join another server as client!!!
//known issues: incorrect new sentry build HP with respect to sentryBuffStats (IDK how to reference the Character object of the owner player of sentry). Haven't checked the sentry gibs issue thing (I may need to sync its bolt gain value)
//RTD mostly untouched apart from Rummy's inclusion of the Stomp attack for effect 16
object_event_add(Character,ev_create,0,"