- ## Copyright (c) 2012, Electronic Arts Inc. All rights reserved.
- ###########################################
- ## CHEAT BUGS -- Use placeable bugs to make fill/empty resources
- ##
- ## Cheating is fun
- ###########################################
- ## Cheating Trades
- ## When you want to cheat, these bugs may be helpful.
- # This just allows us to create cheat bugs that can add Power, Water, Sewage and whatever else is needed
- define IWantToCheat( What Thing )
- unitRule CreateBug_&{What}&{Thing}
- maxApplyCount
- timeTrigger hour 0 -fromCreate -count 1
- ## Fill / Empty either Connected, Global, or Package
- if ( match (&{What}, "Fill"))
- #nearby &{Thing} out 1
- elseif ( match (&{What}, "Empty"))
- #nearby &{Thing} in 1
- elseif ( match (&{What}, "FillConnected"))
- connected &{Thing} out 1
- elseif ( match (&{What}, "EmptyConnected"))
- connected &{Thing} in 1
- elseif ( match (&{What}, "FillGlobal"))
- global &{Thing} out 1
- elseif ( match (&{What}, "EmptyGlobal"))
- global &{Thing} in 1
- elseif ( match (&{What}, "GetPackage"))
- local &{Thing} atLeast 1
- elseif ( match (&{What}, "SendPackage"))
- local &{Thing} in 1
- package &{Thing} out 1
- endif
- successEvent text "&{What} &{Thing}!"
- failEvent text "failed!"
- chain CreateBug_Destroy
- end
- enddef
- unitRule CreateBug_Destroy
- onSuccess -destroyUnit # destroy
- onFail -destroyUnit # and destroy... no survivors!
- end
- create IWantToCheat(Fill Power) # This allows you to add power (you act as a package)
- create IWantToCheat(Fill Water) # """
- #create IWantToCheat(Fill Sewage) # """
- create IWantToCheat(Fill Garbage) # """
- create IWantToCheat(Fill StudentStudyingE2)
- create IWantToCheat(Fill StudentStudyingE3)
- create IWantToCheat(Fill Coal) # """
- #create IWantToCheat(Fill TotalWorkers) # """
- create IWantToCheat(FillConnected Connected)
- create IWantToCheat(FillGlobal Simoleons) # make me rich dude
- #create IWantToCheat(Empty Power) # This cheat allows you to empty power
- #create IWantToCheat(Empty Water) # same but with water
- #create IWantToCheat(Empty Sewage) # " " Sewage
- #create IWantToCheat(Empty Garbage)
- #create IWantToCheat(Empty StudentStudyingE2)
- #create IWantToCheat(Empty StudentStudyingE3)
- create IWantToCheat(Empty Coal)
- #create IWantToCheat(Empty TotalWorkers)
- create IWantToCheat(EmptyConnected Connected)
- create IWantToCheat(EmptyGlobal Simoleons) # make me rich dude
- #create IWantToCheat(UnlockAll) #
- define TradingCheatWithSpecificValue( operator thing value )
- unitRule CreateBug_Trading&{operator}&{thing}
- applyCount &{value}
- timeTrigger hour 0 -fromCreate -count 1
- ## Add or subtract
- if ( match (&{operator}, "AddTo"))
- connected &{thing} out 1
- # print "added to a thing"
- else
- connected &{thing} in 1
- endif
- chain CreateBug_TradingDestroy
- end
- enddef
- unitRule CreateBug_TradingDestroy
- onSuccess -destroyUnit # destroy
- onFail -destroyUnit # and destroy... no survivors!
- end
- create TradingCheatWithSpecificValue( AddTo Water 10 )
- create TradingCheatWithSpecificValue( AddTo Power 16 )
- create TradingCheatWithSpecificValue( AddTo FireTruckT2 1 )
- create TradingCheatWithSpecificValue( AddTo Ambulance 1 )
- create TradingCheatWithSpecificValue( AddTo HazMatTruck 1 )
- create TradingCheatWithSpecificValue( AddTo ResidentW1 25 )
- create TradingCheatWithSpecificValue( SubtractFrom Water 10 )
- create TradingCheatWithSpecificValue( SubtractFrom Power 16 )
- create TradingCheatWithSpecificValue( SubtractFrom FireTruckT2 1 )
- create TradingCheatWithSpecificValue( SubtractFrom Ambulance 1 )
- #create TradingCheatWithSpecificValue( SubtractFrom HazMatTruck 1 )
- create TradingCheatWithSpecificValue( SubtractFrom ResidentW1 25 )
- unitRule CreateBug_MakeTradingConnection
- # Note that this will only create one city connection - all other connections will be sim nation connections
- applyCount 1
- timeTrigger hour 0 -fromCreate -count 1
- connected Connected is 0
- #connected NumberOfConnections atLeast 1
- onSuccess CreateBug_FillTradeConnectionsBins
- onFail -destroyUnit
- end
- unitRule CreateBug_FillTradeConnectionsBins
- maxApplyCount
- # allow trades
- #connected FireTradeToken out 1
- #connected HealthTradeToken out 1
- #connected EducationE2TradeToken out 1
- #connected GarbageTradeToken out 1
- connected Connected out 1
- # allow dispatching in box
- #connected FireTradeTokenDispatch out 1
- #connected HealthTradeTokenDispatch out 1
- #connected EducationE2TradeTokenDispatch out 1
- #connected GarbageTradeTokenDispatch out 1
- onSuccess -destroyUnit
- onFail -destroyUnit
- end
- unitRule Cheat_SendHelicopterTest1
- applyCount 1
- timeTrigger Hour 0.01 -fromCreate -count 1
- options -createAgent FireHelicopter
- agent FireHelicopter out 1
- options -sendTo Nowhere -using Helicopter
- onSuccess -destroyUnit
- end
- ### add hourly income
- unitRule Cheats_AddHourlyIncome
- applyCount 1 5000
- global Income out 1
- global IncomeFromIW3 out 1
- global AdjustedIncome out 1
- onSuccess -destroyUnit
- onFail -destroyUnit
- end
- ## Agent sending cheats (we should try and macro this eventaully too!)
- define Cheat_SendFireTruck( tier )
- unitRule Cheat_SendFireTruck&{tier}
- applyCount 1
- options -createAgent FireTruck&{tier}
- agent FireTruck&{tier} out 1
- onSuccess Cheat_SendFireTruck_LoadFirefighters
- end
- enddef
- unitRule Cheat_SendFireTruck_LoadFirefighters
- maxApplyCount
- agent Firefighter out 1
- options -sendTo ActiveFire -using CarTraffic #-or FireTruck&{tier}Garage
- onSuccess -destroyUnit
- end
- create Cheat_SendFireTruck( T1 )
- create Cheat_SendFireTruck( T2 )
- unitRule Cheat_SendHazMatTruck
- applyCount 1
- options -createAgent HazMatTruck
- agent HazMatTruck out 1
- options -sendTo HazMatFire -or HazMatGarage -using CarTraffic #-ifPossible
- onSuccess -destroyUnit
- end
- unitRule Cheat_TargetCheat
- applyCount 1
- options -createAgent CriminalSignal
- agent CriminalRequest out 1
- options -sendTo Cheat_SetAsTarget -using radial -dieAfter 1 #-ifPossible
- onSuccess -destroyUnit
- onFail -destroyUnit
- end
- unitRule Cheat_TriggerGeneralVignette
- applyCount 1
- options -sendTo Cheat_TriggerGeneralVignette -via sendTo -using radial -dieAfter 20
- onSuccess -destroyUnit
- onFail -destroyUnit
- end
- unitRule Cheat_ReceiveTriggerGeneralVignette
- applyCount 1
- successEvent vignette GeneralID -start
- end
- define Cheat_SendCoalTruck( tier transport)
- unitRule Cheat_SendCoalTruck&{tier}
- options -createAgent &{transport}_Coal
- agent Coal out 1000
- options -sendTo GreatWorksCoalConsumer -or CoalConsumer_Road -or CoalConsumerStorage_Road -or MovingOutOfTheCity -using CarTraffic
- onSuccess -destroyUnit
- end
- enddef
- create Cheat_SendCoalTruck ( T1 T_Coal_T1_SmallTruck )
- create Cheat_SendCoalTruck ( T2 T_Coal_T2_LargeTruck )
- define Cheat_SendPatrolCar ( vehicle )
- unitRule Cheat_Send&{vehicle}
- options -createAgent &{vehicle}
- agent Police out 1
- options -sendTo CrimeInProgress -using CarTraffic
- onSuccess -destroyUnit
- end
- enddef
- create Cheat_SendPatrolCar ( PatrolCar )
- #create Cheat_SendPatrolCar ( FrenchPatrolCar )
- unitRule Cheat_SendAmbulance
- applyCount 1
- options -createAgent Ambulance
- agent Ambulance out 1
- options -sendTo NeedsAmbulance -or AmbulanceGarage -or MovingOutOfTheCity
- successEvent audio play_ambulance_dispatch
- onSuccess -destroyUnit
- end
- ## Send Generic Rail Macro
- # rail cheat macro
- define CheatRail_( vehicle )
- unitRule CheatRail_&{vehicle}
- options -createAgent &{vehicle}
- agent &{vehicle} out 1
- options -sendTo NowhereRail -using LightRail
- onSuccess -destroyUnit
- end
- enddef
- create CheatRail_( LightTrainT1 )
- define CheatHeavyRail_( vehicle )
- unitRule CheatHeavyRail_&{vehicle}
- options -createAgent &{vehicle}
- agent &{vehicle} out 1
- options -sendTo NowhereHeavyRail -using HeavyRail
- onSuccess -destroyUnit
- end
- enddef
- create CheatHeavyRail_( TrainT2 )
- #create CheatHeavyRail_( GermanTrainT2 )
- ## Send Generic Vehicle Macro
- # vehicle cheat macro
- define Cheat_( vehicle transport )
- unitRule Cheat_&{transport}
- options -createAgent &{transport}
- agent &{vehicle} out 1
- options -sendTo Nowhere -using CarTraffic
- onSuccess -destroyUnit
- end
- enddef
- #create Cheat_( BusT2 LondonBusT2 )
- create Cheat_( BusT2 BusT2 )
- create Cheat_( CruiseShipT2 CruiseShipT2 )
- define Cheat_ConstructionTruck( density )
- unitRule Cheat_ConstructionTruck&{density}
- options -createAgent ConstructionTruck&{density}
- agent ConstructionTruck&{density} out 1
- options -sendTo ConstructionResLocation&{density} -or ConstructionLocation&{density} -using CarTraffic
- onSuccess -destroyUnit
- end
- enddef
- create Cheat_ConstructionTruck( D1 )
- create Cheat_ConstructionTruck( D2 )
- create Cheat_ConstructionTruck( D3 )
- # custom vehicle cheats that don't fit the macro
- unitRule Cheat_FreightTruckGenD1_Empty
- options -createAgent FreightTruckGenD1_Empty
- agent FreightTruckGenD1 out 1
- options -sendTo Nowhere -using CarTraffic
- onSuccess -destroyUnit
- end
- unitRule Cheat_FireInspectorTransport
- options -createAgent FireInspectorTransport
- agent FireInspector out 1
- options -sendTo Nowhere -using CarTraffic
- onSuccess -destroyUnit
- end
- ## Work/Shop/Home W1/W2/W3 Pedestrian Generator
- define Cheat_SendPedMulti( number wealth destination next )
- unitRule Cheat_SendPedMulti_&{number}
- applyCount 1
- global CheatSendPedMulti is &{number}
- onSuccess Cheat_SendPedMulti_&{number}_MakeAgent
- if ( not match (&{next}, "0"))
- onFail Cheat_SendPedMulti_&{next}
- endif
- end
- unitRule Cheat_SendPedMulti_&{number}_MakeAgent
- applyCount 1
- if (match(&{destination},"Shop"))
- agent SimShopperW&{wealth} out 1
- else
- agent SimWorkerW&{wealth} out 1
- endif
- if (match(&{destination},"Home"))
- options -sendTo &{destination}W&{wealth}Worker_Sidewalk -via Transport_PedestrianW&{wealth}
- else
- options -sendTo &{destination}W&{wealth}_Sidewalk -via Transport_PedestrianW&{wealth}
- endif
- onSuccess Cheat_SendPedMulti_Inc
- end
- enddef
- create Cheat_SendPedMulti(0 1 Home 1)
- create Cheat_SendPedMulti(1 1 Work 2)
- create Cheat_SendPedMulti(2 1 Shop 3)
- create Cheat_SendPedMulti(3 2 Home 4)
- create Cheat_SendPedMulti(4 2 Work 5)
- create Cheat_SendPedMulti(5 2 Shop 6)
- create Cheat_SendPedMulti(6 3 Home 7)
- create Cheat_SendPedMulti(7 3 Work 8)
- create Cheat_SendPedMulti(8 3 Shop 0)
- unitRule Cheat_SendPedMulti_Inc
- applyCount 1
- global CheatSendPedMulti out 1
- onSuccess Cheat_Die
- onFail Cheat_SendPedMulti_Reset
- end
- unitRule Cheat_SendPedMulti_Reset
- maxApplyCount
- global CheatSendPedMulti in 1
- chain Cheat_Die
- end
- ## Work/Shop/Home W1/W2/W3 Car Generator
- define Cheat_SendCarMulti( number wealth destination next )
- unitRule Cheat_SendCarMulti_&{number}
- applyCount 1
- global CheatSendCarMulti is &{number}
- onSuccess Cheat_SendCarMulti_&{number}_MakeAgent
- if ( not match (&{next}, "0"))
- onFail Cheat_SendCarMulti_&{next}
- endif
- end
- unitRule Cheat_SendCarMulti_&{number}_MakeAgent
- applyCount 1
- if (match(&{destination},"Shop"))
- agent SimShopperW&{wealth} out 1
- else
- agent SimWorkerW&{wealth} out 1
- endif
- agent FromTradingConnection out 1
- if (match(&{destination},"Home"))
- options -sendTo &{destination}W&{wealth}Worker_Sidewalk -or MovingOutOfTheCity -via Transport_CarW&{wealth}
- else
- options -sendTo &{destination}W&{wealth}_Road -or MovingOutOfTheCity -via Transport_CarW&{wealth}
- endif
- onSuccess Cheat_SendCarMulti_Inc
- end
- enddef
- create Cheat_SendCarMulti(0 1 Home 1)
- create Cheat_SendCarMulti(1 1 Work 2)
- create Cheat_SendCarMulti(2 1 Shop 3)
- create Cheat_SendCarMulti(3 2 Home 4)
- create Cheat_SendCarMulti(4 2 Work 5)
- create Cheat_SendCarMulti(5 2 Shop 6)
- create Cheat_SendCarMulti(6 3 Home 7)
- create Cheat_SendCarMulti(7 3 Work 8)
- create Cheat_SendCarMulti(8 3 Shop 0)
- unitRule Cheat_SendCarMulti_Inc
- applyCount 1
- global CheatSendCarMulti out 1
- onSuccess Cheat_Die
- onFail Cheat_SendCarMulti_Reset
- end
- unitRule Cheat_SendCarMulti_Reset
- maxApplyCount
- global CheatSendCarMulti in 1
- chain Cheat_Die
- end
- ## Car Generator
- unitRule Cheat_SendCar
- applyCount 1
- global CheatCycle is 0
- onSuccess Cheat_SendCarW1
- onFail Cheat_SendCarW2_Test
- end
- unitRule Cheat_SendCarW2_Test
- applyCount 1
- global CheatCycle is 1
- onSuccess Cheat_SendCarW2
- onFail Cheat_SendCarW3
- end
- unitRule Cheat_SendCarW1
- applyCount 1
- agent SimWorkerW1 out 1
- agent FromTradingConnection out 1
- options -sendTo HomeW1Worker_Sidewalk -or MovingOutOfTheCity -via Transport_CarW1 -using CarTraffic
- chain Cheat_CyclePlusOne
- end
- unitRule Cheat_SendCarW2
- applyCount 1
- agent SimWorkerW2 out 1
- agent FromTradingConnection out 1
- options -sendTo HomeW2Worker_Sidewalk -or MovingOutOfTheCity -via Transport_CarW2 -using CarTraffic
- chain Cheat_CyclePlusOne
- end
- unitRule Cheat_SendCarW3
- applyCount 1
- agent SimWorkerW3 out 1
- agent FromTradingConnection out 1
- options -sendTo HomeW3Worker_Sidewalk -or MovingOutOfTheCity -via Transport_CarW3 -using CarTraffic
- chain Cheat_CycleReset
- end
- ## Pedestrian Generator
- #Sends one of each type of pedestrian
- unitRule Cheat_SendPedestrians
- applyCount 1
- agent SimWorkerW1 out 1
- options -sendTo HomeW1Worker_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_PedestrianW1 -using PedestrianTraffic
- chain Cheat_SendPedestriansW1
- end
- unitRule Cheat_SendPedestriansW1
- applyCount 1
- agent SimWorkerW1 out 1
- options -sendTo HomeW1Worker_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_PedestrianW1 -using PedestrianTraffic
- chain Cheat_SendMorePedestriansW1
- end
- unitRule Cheat_SendMorePedestriansW1
- applyCount 1
- agent SimWorkerW1 out 1
- options -sendTo HomeW1Worker_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_PedestrianW1 -using PedestrianTraffic
- chain Cheat_SendPedestriansW2
- end
- unitRule Cheat_SendPedestriansW2
- applyCount 1
- agent SimWorkerW2 out 1
- options -sendTo HomeW2Worker_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_PedestrianW2 -using PedestrianTraffic
- chain Cheat_SendPedestriansW3
- end
- unitRule Cheat_SendPedestriansW3
- applyCount 1
- agent SimWorkerW3 out 1
- options -sendTo HomeW3Worker_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_PedestrianW3 -using PedestrianTraffic
- chain Cheat_SendKid
- end
- unitRule Cheat_SendKid
- applyCount 1
- agent KidE2 out 1
- options -sendTo HomeKid_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_KidE2 -using PedestrianTraffic
- end
- #Sends a single pedestrian, cycling through W1, W2, and W3
- unitRule Cheat_SendPedestrian
- applyCount 1
- global CheatCycle is 0
- onSuccess Cheat_SendPedestrianW1
- onFail Cheat_SendPedestrianW2_Test
- end
- unitRule Cheat_SendPedestrianW2_Test
- applyCount 1
- global CheatCycle is 1
- onSuccess Cheat_SendPedestrianW2
- onFail Cheat_SendPedestrianW3
- end
- unitRule Cheat_SendPedestrianW1
- applyCount 1
- agent SimWorkerW1 out 1
- options -sendTo HomeW1Worker_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_PedestrianW1 -using PedestrianTraffic
- chain Cheat_CyclePlusOne
- end
- unitRule Cheat_SendPedestrianW2
- applyCount 1
- agent SimWorkerW2 out 1
- options -sendTo HomeW2Worker_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_PedestrianW2 -using PedestrianTraffic
- chain Cheat_CyclePlusOne
- end
- unitRule Cheat_SendPedestrianW3
- applyCount 1
- agent SimWorkerW3 out 1
- options -sendTo HomeW3Worker_Sidewalk -or MovingOutOfTheCityPedestrian -via Transport_PedestrianW3 -using PedestrianTraffic
- chain Cheat_CycleReset
- end
- ## State Change Rules
- # Test for 'vacant'
- unitRule Cheat_CycleState
- timeTrigger hour 0 -fromCreate -count 1
- applyCount 1
- global CheatCycle is 0
- onSuccess Cheat_CyclePlusOne
- onFail Cheat_SendState_Abandoned_Test
- end
- # Test for 'abandoned'
- unitRule Cheat_SendState_Abandoned_Test
- applyCount 1
- global CheatCycle is 1
- onSuccess Cheat_SendState_Abandoned
- onFail Cheat_SendState_Rubble_Test
- end
- # Test for 'rubble'
- unitRule Cheat_SendState_Rubble_Test
- applyCount 1
- global CheatCycle is 2
- onSuccess Cheat_SendState_Rubble
- onFail Cheat_SendState_UnderConstruction_Test
- end
- # Test for 'under construction', otherwise 'normal'
- unitRule Cheat_SendState_UnderConstruction_Test
- applyCount 1
- global CheatCycle is 3
- onSuccess Cheat_SendState_UnderConstruction
- onFail Cheat_SendState_Normal
- end
- # Set state to 'Abandoned'
- unitRule Cheat_SendState_Abandoned
- maxApplyCount
- agent Abandoned out 1
- options -sendTo StateChange -via StateChange -dieAfter 1
- chain Cheat_CyclePlusOne
- end
- # Set state to 'Rubble'
- unitRule Cheat_SendState_Rubble
- maxApplyCount
- agent Rubble out 1
- options -sendTo StateChange -via StateChange -dieAfter 1
- chain Cheat_CyclePlusOne
- end
- # Set state to 'Under Construction'
- unitRule Cheat_SendState_UnderConstruction
- maxApplyCount
- agent UnderConstruction out 1
- options -sendTo StateChange -via StateChange -dieAfter 1
- chain Cheat_CyclePlusOne
- end
- # Set state to 'Normal'
- unitRule Cheat_SendState_Normal
- maxApplyCount
- agent Normal out 1
- options -sendTo StateChange -via StateChange -dieAfter 1
- chain Cheat_CycleReset
- end
- # turn vandalism on/off sink rules
- #unitRule Cheat_VandalismOn
- # maxApplyCount
- # local VandalismLevel out 1
- #end
- #unitRule Cheat_VandalismOff
- # maxApplyCount
- # local VandalismLevel in 1
- #end
- ## Cycle Rules
- unitRule Cheat_CyclePlusOne
- applyCount 1
- global CheatCycle out 1
- chain Cheat_Die
- end
- unitRule Cheat_CycleReset
- maxApplyCount
- global CheatCycle in 1
- chain Cheat_Die
- end
- unitRule Cheat_Die
- onSuccess -destroyUnit
- onFail -destroyUnit
- end
- ## Traffic
- unitRule Cheat_AddTraffic
- maxApplyCount
- options -region D
- map Density_D2 out 1
- map Density_D3 out 1
- chain Cheat_Die
- end
- unitRule Cheat_RemoveTraffic
- maxApplyCount
- options -region D
- map Density_D2 in 1
- map Density_D3 in 1
- chain Cheat_Die
- end
- ##Make the city D2
- unitRule Cheat_MakeD2
- maxApplyCount
- options -region D
- map Density_D2 out 1
- map Density_D3 out 1
- chain Cheat_Die
- end
- unitRule CreateBug_AddDensityD2
- options -region A
- map Density_D2 out 1
- chain Cheat_Die
- end
- unitRule CreateBug_AddDensityD3
- options -region A
- map Density_D3 out 1
- chain Cheat_Die
- end
- #unitRule Cheat_MakeW2
- # maxApplyCount
- # options -region D
- # map Desirability_CW2 out 500
- # map Desirability_CW3 out 500
- # map Desirability_RW2 out 500
- # map Desirability_RW3 out 500
- # chain Cheat_Die
- #end