////////////////////////////////////////////////////////////////////////////// // Hold the Black Flag rules common to holdflag and fusion ////////////////////////////////////////////////////////////////////////////// // in holdflag the black flag is a strategic item if startup1 then deploy bkflagbase, deploy blackflag1, setitemflag blackflag1 strategic 1, setitemflag blackflag1 stratsquare 1 // @1 = color, @2 = Capitalized color (e.g. "Green") macro holdflag_rules 2 { // these pairs of variables are used to prevent sarge dropping and picking up the flag // within 1 second and scoring at a double rate variable @1PickupFlagCount 0 variable @1KeepsFlagCheck 0 // check for @1 sarge holding the flag if pickedup blackflag1 by @1sarge1 then showmessage "@2 holds the flag", playsound "mp_gotflag.wav" (0,0) 3 1, addvar @1PickupFlagCount 1, triggerdelay 3000 check@1holdsflag, addscoresymbol @1 flag if dropped blackflag1 by @1sarge1 then removescoresymbol @1 flag if check@1holdsflag then addvar @1KeepsFlagCheck 1 if check@1holdsflag testvar hasitem @1sarge1 blackflag1 = 1 then trigger check@1scores if check@1scores testvar hasitem @1sarge1 blackflag1 = 1 and @1KeepsFlagCheck = @1PickupFlagCount then addvar @1score holdFlagBonus, playsound "mp_tick.wav" (0,0) 2 3, trigger check@1wins, triggerdelay 3000 check@1scores } expand holdflag_rules ( green "Green" ) expand holdflag_rules ( tan "Tan" ) expand holdflag_rules ( blue "Blue" ) expand holdflag_rules ( grey "Grey" ) // if flag is dropped and not picked up for 2 minutes then return it to it's base variable flagTimeOutVar 0 variable flagLastTimeOutVar 1 if dropped blackflag1 then triggerdelay 120000 flagCheckTimeOut if pickedup blackflag1 then addvar flagTimeOutVar 1 if flagCheckTimeOut testvar flagTimeOutVar = flagLastTimeOutVar then showmessage "Black Flag was dropped and not picked up for 2 minutes - moved to base", createexplosion blackflag1 128 0 green, playsound "mp_rebaseflag.wav" (0,0) 2 1, moveitem blackflag1 bkflagbase, triggerdelay 1000 flagLastTimeOutIncr if flagCheckTimeOut testvar flagTimeOutVar <> flagLastTimeOutVar then triggerdelay 1000 flagLastTimeOutIncr if flagLastTimeOutIncr then addvar flagLastTimeOutVar 1