Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- EVIL MASTERMIND DUOMENU SCRIPT
- -- SIMPLE MENU
- if not SimpleMenu then
- SimpleMenu = class()
- function SimpleMenu:init(title, message, options)
- self.dialog_data = { title = title, text = message, button_list = {},
- id = tostring(math.random(0,0xFFFFFFFF)) }
- self.visible = false
- for _,opt in ipairs(options) do
- local elem = {}
- elem.text = opt.text
- opt.data = opt.data or nil
- opt.callback = opt.callback or nil
- elem.callback_func = callback(self, self, "_do_callback",
- { data = opt.data,
- callback = opt.callback})
- elem.cancel_button = opt.is_cancel_button or false
- if opt.is_focused_button then
- self.dialog_data.focus_button = #self.dialog_data.button_list+1
- end
- table.insert(self.dialog_data.button_list, elem)
- end
- return self
- end
- function SimpleMenu:_do_callback(info)
- if info.callback then
- if info.data then
- info.callback(info.data)
- else
- info.callback()
- end
- end
- self.visible = false
- end
- function SimpleMenu:show()
- if self.visible then
- return
- end
- self.visible = true
- managers.system_menu:show(self.dialog_data)
- end
- function SimpleMenu:hide()
- if self.visible then
- managers.system_menu:close(self.dialog_data.id)
- self.visible = false
- return
- end
- end
- end
- patched_update_input = patched_update_input or function (self, t, dt )
- if self._data.no_buttons then
- return
- end
- local dir, move_time
- local move = self._controller:get_input_axis( "menu_move" )
- if( self._controller:get_input_bool( "menu_down" )) then
- dir = 1
- elseif( self._controller:get_input_bool( "menu_up" )) then
- dir = -1
- end
- if dir == nil then
- if move.y > self.MOVE_AXIS_LIMIT then
- dir = 1
- elseif move.y < -self.MOVE_AXIS_LIMIT then
- dir = -1
- end
- end
- if dir ~= nil then
- if( ( self._move_button_dir == dir ) and self._move_button_time and ( t < self._move_button_time + self.MOVE_AXIS_DELAY ) ) then
- move_time = self._move_button_time or t
- else
- self._panel_script:change_focus_button( dir )
- move_time = t
- end
- end
- self._move_button_dir = dir
- self._move_button_time = move_time
- local scroll = self._controller:get_input_axis( "menu_scroll" )
- -- local sdir
- if( scroll.y > self.MOVE_AXIS_LIMIT ) then
- self._panel_script:scroll_up()
- -- sdir = 1
- elseif( scroll.y < -self.MOVE_AXIS_LIMIT ) then
- self._panel_script:scroll_down()
- -- sdir = -1
- end
- end
- managers.system_menu.DIALOG_CLASS.update_input = patched_update_input
- managers.system_menu.GENERIC_DIALOG_CLASS.update_input = patched_update_input
- ------------------------------
- ------ GLOBAL SETTINGS -------
- ------------------------------
- -- SHOW MENU
- show_menu = show_menu or function(menu)
- menu:show()
- end
- -- CALL MENU
- function openmenu(menu)
- menu:show()
- end
- function inGame()
- if not game_state_machine then return false end
- return string.find(game_state_machine:current_state_name(), "game")
- end
- function show_mid_text( msg, msg_title, show_secs )
- if managers and managers.hud then
- managers.hud:present_mid_text( { text = msg, title = msg_title, time = show_secs } )
- end
- end
- ----------------------
- -- OUTGAME SETTINGS --
- ----------------------
- if not inGame() then
- end
- ---------------------------
- ---- INGAME SETTINGS ------
- ---------------------------
- if inGame() and managers.platform:presence() == "Playing" then
- ---------------------------
- -- BACKUP FOR NORMALIZER --
- ---------------------------
- if not _cableTie then _cableTie = PlayerManager.remove_special
- end
- if not _useMessiah then _useMessiah = PlayerDamage.consume_messiah_charge
- end
- if not _gotMessiah then _gotMessiah = PlayerDamage.got_messiah_charges
- end
- if not _dBaguse then _dBaguse = DoctorBagBase._take
- end
- if not _infPager then _infPager = GroupAIStateBase.on_successful_alarm_pager_bluff
- end
- if not _PlyUpgVal then _PlyUpgVal = PlayerManager.upgrade_value
- end
- if not _onIntimidated then _onIntimidated = CopLogicIdle.on_intimidated
- end
- if not _onIIntimidated then _onIIntimidated = CopLogicIntimidated.on_intimidated
- end
- if not _onSniperEnter then _onSniperEnter = CopLogicSniper.enter
- end
- if not _civDeduct then _civDeduct = MoneyManager.get_civilian_deduction
- end
- if not _civKilled then _civKilled = MoneyManager.civilian_killed
- end
- ---------------------
- ---- FUNCTIONS ------
- ---------------------
- -- INFINITE CABLE TIES (normalizable)
- infcable = infcable or function()
- function PlayerManager:remove_special( name )
- end
- end
- -- INFINITE MESSIAH CHARGES ((SELF-REVIVE) normalizable)
- infmessiah = infmessiah or function()
- function PlayerDamage:consume_messiah_charge() return true
- end
- end
- -- UNLOCK MESSIAH CHARGES SKILL ((SELF-REVIVE) normalizable)
- unlmessiah = unlmessiah or function()
- function PlayerDamage:got_messiah_charges() return true
- end
- end
- -- INFINITE DOCTOR BAG USES (normalizable)
- infdocbag = infdocbag or function()
- function DoctorBagBase:_take( unit )
- unit:character_damage():recover_health() -- replenish()
- return 0
- end
- end
- -- ALLOW INFINITE PAGERS (normalizable)
- infpager = infpager or function()
- function GroupAIStateBase:on_successful_alarm_pager_bluff()
- end
- end
- -- NO CASH PENALTY FOR KILLING CIVILIANS (normalizable)
- frekillz = frekillz or function()
- function MoneyManager.get_civilian_deduction()
- return 0
- end
- function MoneyManager.civilian_killed()
- return
- end
- end
- -- 3 CONVERTS (normalizable)
- infconvert2 = infconvert2 or function()
- function PlayerManager:upgrade_value( category, upgrade, default )
- if category == "player" and upgrade == "convert_enemies" then
- return true
- elseif category == "player" and upgrade == "convert_enemies_max_minions" then
- return 3
- elseif category == "player" and upgrade == "convert_enemies_health_multiplier" then
- return 0.25
- elseif category == "player" and upgrade == "convert_enemies_damage_multiplier" then
- return 2.5
- else
- return _PlyUpgVal(self, category, upgrade, default)
- end
- end
- end
- -- INSTANT INTIMIDATIONS (normalizable)
- infintim = infintim or function()
- function CopLogicIdle.on_intimidated( data, amount, aggressor_unit )
- if aggressor_unit == managers.player:player_unit() then
- CopLogicIdle._surrender( data, amount )
- return true
- else
- return _onIntimidated(data, amount, aggressor_unit)
- end
- end
- CopLogicAttack.on_intimidated = CopLogicIdle.on_intimidated
- CopLogicArrest.on_intimidated = CopLogicIdle.on_intimidated
- CopLogicSniper.on_intimidated = CopLogicIdle.on_intimidated
- -- SHIELD LOGIC
- CopBrain._logic_variants.shield.intimidated = CopLogicIntimidated
- function CopLogicIntimidated.on_intimidated( data, amount, aggressor_unit )
- -- If shield we skip animations, go straight to conversion & spawn a new shield since it was destroyed during intimidation
- if data.unit:base()._tweak_table == "shield" then
- CopLogicIntimidated._do_tied( data, aggressor_unit )
- CopInventory._chk_spawn_shield( data.unit:inventory(), nil )
- else
- _onIIntimidated(data, amount, aggressor_unit)
- end
- -- PROPER SNIPER ((100% ACCURACY, NO SPREAD) normalizable)
- CopBrain._logic_variants.sniper = clone( CopBrain._logic_variants.security )
- CopBrain._logic_variants.sniper.attack = CopLogicSniper
- function CopLogicSniper.enter( data, new_logic_name, enter_params )
- if data.unit:brain()._logic_data and data.unit:brain()._logic_data.objective and data.unit:brain()._logic_data.objective.type == "follow" then
- data.char_tweak.weapon[ data.unit:inventory():equipped_unit():base():weapon_tweak_data().usage ] = tweak_data.character.presets.weapon.sniper.m4
- data.char_tweak.weapon[ data.unit:inventory():equipped_unit():base():weapon_tweak_data().usage ].spread = 0
- -- Get dat 100% accuracy
- for distance=1, 3 do
- for interpolate=1,2 do
- data.char_tweak.weapon[ data.unit:inventory():equipped_unit():base():weapon_tweak_data().usage ].FALLOFF[distance].acc[interpolate] = 1
- end
- end
- end
- _onSniperEnter(data, new_logic_name, enter_params)
- end
- end
- end
- gagballcloakers = gagballcloakers or function()
- dofiles("trainer/assets/stfucloaker.lua")
- end
- -----------------------
- -- ACTIVATE MMCHEATS --
- -----------------------
- mastermindset = mastermindset or function()
- infcable()
- infmessiah()
- unlmessiah()
- infdocbag()
- infpager()
- infconvert2()
- infintim()
- frekillz()
- show_mid_text("..now go do your evil deeds", "Evil mastermind", 2 )
- end
- ------------------------------
- --P---- MENU CONTENT ------C--
- ------------------------------
- -- ROOT MENU INGAME
- masopt = masopt or {
- { text = "Exit", is_cancel_button = true},
- {},
- { text = "Cloaker VLF repeater", callback = gagballcloakers },
- {},
- { text = "Activate evil mastermind", callback = mastermindset },
- }
- -- ROOT MENU OUTGAME
- if not mastermindmenu then
- mastermindmenu = mastermindmenu or SimpleMenu:new("Evil Mastermind", ".. have you been bad today?", masopt)
- end
- -- SHOW MASTERMIND INGAME MENU
- if inGame() and managers.platform:presence() == "Playing" then
- mastermindmenu:show()
- else
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement