Before we start, if you think I'm making the game easier, then feel free to think that. I did it on a mere whim.I dunno if anyone's ever done
this before, but I've made it so where you gain the benefits of the "ai-cheating.lua" Here's a file in case you're wanting to try it out for yourself. With this AI, you:
+Gain 500 LP during your Draw Phase and draw 1 extra card.
+Can Normal Summon up to 5 times.
+Cannot lose the Duel if your LP reaches 0 (however, you can lose due to card effects such as Duel Winners like Exodia.)
New Features (Optional additions):
+Cannot lose the Duel by Decking Out nor effect
+Can have more than 10 cards in your Hand.
+Your monsters can have a permanent 500 ATK/DEF boost (This can be modified to whatever you like).
+Monsters in your hand can either have their Level raised or lowered, making it easier/harder to summon them.
+Monsters on your side of the field can count as two tributes.
+Monsters in the Monster Zone cannot be destroyed by battle and/or effect.
+Your opponent's hand is always face-up.
+You need one less tribute for Higher-Level Monsters.
+Any of your Monsters can declare an Attack in Defense Position.
+Battle Damage your opponent inflicts on you is bounced back.
+You only need to pay 1 Life Point in order to activate
anything at all.
+Your opponent cannot use Monster Effects (Change to LOCATION_SZONE so the opponent cannot use Spells/Traps, or LOCATION_ONFIELD so that your opponent cannot use either of them).
+Assuming your Monsters were to be destroyed by Battle only, they return to your Hand.
+Activate Trap Cards in your Hand.
+Your monsters cannot be targeted as either Battle or Effect targets.
+Instead of
taking damage, you absorb any direct damage you take.
+Inflict Piercing damage to your opponent, no matter what.
+Never take
any Battle Damage and/or Effect Damage*.
+Attack Directly at will.
+Your opponent's effects will not Trigger anywhere.
+You can forbid your opponent from being able to attack.
* - e26 and e27
must be used together for it to work.
If you'd rather not download it, you can copy and paste it onto the "ai-cheating.lua" down below.
-- A cheating AI file, which draws additional cards and recovers LP each turn
-- Configure these to your liking
require("ai.ai")
EXTRA_SUMMON = 5
EXTRA_DRAW = 1
LP_RECOVER = 500
GlobalCheating = true
math.randomseed( require("os").time() )
function EnableCheats()
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_PHASE+PHASE_DRAW)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-player_ai
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
--AI.Chat("Oh yeah, cheating feels good.")
Duel.Draw(1-player_ai,EXTRA_DRAW,REASON_RULE)
Duel.Recover(1-player_ai,LP_RECOVER,REASON_RULE)
end)
Duel.RegisterEffect(e1,player_ai)
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetValue(EXTRA_SUMMON)
Duel.RegisterEffect(e2,1-player_ai)
local e3=Effect.GlobalEffect()
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_LOSE_LP)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetValue(1)
Duel.RegisterEffect(e3,1-player_ai)
end
New Features (Optional):
local e4=Effect.GlobalEffect()
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_LOSE_DECK)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetValue(1)
Duel.RegisterEffect(e4,1-player_ai)
local e5=Effect.GlobalEffect()
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_LOSE_EFFECT)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,0)
e5:SetValue(1)
Duel.RegisterEffect(e5,1-player_ai)
local e6=Effect.GlobalEffect()
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_HAND_LIMIT)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,0)
e6:SetValue(10)
Duel.RegisterEffect(e6,1-player_ai)
local e7=Effect.GlobalEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_UPDATE_ATTACK)
e7:SetRange(LOCATION_FZONE)
e7:SetTargetRange(LOCATION_MZONE,0)
e7:SetValue(500)
Duel.RegisterEffect(e7,1-player_ai)
local e8=Effect.GlobalEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EFFECT_UPDATE_DEFENSE)
e8:SetRange(LOCATION_FZONE)
e8:SetTargetRange(LOCATION_MZONE,0)
e8:SetValue(500)
Duel.RegisterEffect(e8,1-player_ai)
local e9=Effect.GlobalEffect(c)
e9:SetType(EFFECT_TYPE_FIELD)
e9:SetCode(EFFECT_UPDATE_LEVEL)
e9:SetRange(LOCATION_FZONE)
e9:SetTargetRange(LOCATION_HAND,0)
e9:SetValue(0)
Duel.RegisterEffect(e9,1-player_ai)
local e10=Effect.GlobalEffect(c)
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_DOUBLE_TRIBUTE)
e10:SetRange(LOCATION_FZONE)
e10:SetTargetRange(LOCATION_MZONE,0)
e10:SetValue(1)
Duel.RegisterEffect(e10,1-player_ai)
local e11=Effect.GlobalEffect(c)
e11:SetType(EFFECT_TYPE_FIELD)
e11:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e11:SetRange(LOCATION_FZONE)
e11:SetTargetRange(LOCATION_MZONE,0)
e11:SetValue(1)
Duel.RegisterEffect(e11,1-player_ai)
local e12=Effect.GlobalEffect(c)
e12:SetType(EFFECT_TYPE_FIELD)
e12:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e12:SetRange(LOCATION_FZONE)
e12:SetTargetRange(LOCATION_MZONE,0)
e12:SetValue(1)
Duel.RegisterEffect(e12,1-player_ai)
local e13=Effect.GlobalEffect(c)
e13:SetType(EFFECT_TYPE_FIELD)
e13:SetCode(EFFECT_PUBLIC)
e13:SetRange(LOCATION_FZONE)
e13:SetTargetRange(0,LOCATION_HAND)
e13:SetValue(1)
Duel.RegisterEffect(e13,1-player_ai)
local e14=Effect.GlobalEffect(c)
e14:SetType(EFFECT_TYPE_FIELD)
e14:SetCode(EFFECT_DECREASE_TRIBUTE)
e14:SetRange(LOCATION_FZONE)
e14:SetTargetRange(0x6,0)
e14:SetValue(1)
Duel.RegisterEffect(e14,1-player_ai)
local e15=Effect.GlobalEffect(c)
e15:SetType(EFFECT_TYPE_FIELD)
e15:SetCode(EFFECT_DEFENSE_ATTACK)
e15:SetRange(LOCATION_FZONE)
e15:SetTargetRange(LOCATION_MZONE,0)
e15:SetValue(1)
Duel.RegisterEffect(e15,1-player_ai)
local e16=Effect.GlobalEffect()
e16:SetType(EFFECT_TYPE_FIELD)
e16:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e16:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e16:SetTargetRange(1,0)
e16:SetValue(1)
Duel.RegisterEffect(e16,1-player_ai)
local e17=Effect.GlobalEffect(c)
e17:SetType(EFFECT_TYPE_FIELD)
e17:SetCode(EFFECT_LPCOST_CHANGE)
e17:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e17:SetRange(LOCATION_FZONE)
e17:SetTargetRange(1,0)
e17:SetValue(1)
Duel.RegisterEffect(e17,1-player_ai)
local e18=Effect.GlobalEffect(c)
e18:SetType(EFFECT_TYPE_FIELD)
e18:SetCode(EFFECT_DISABLE)
e18:SetRange(LOCATION_FZONE)
e18:SetTargetRange(0,LOCATION_MZONE)
e18:SetValue(1)
Duel.RegisterEffect(e18,1-player_ai)
local e19=Effect.GlobalEffect(c)
e19:SetType(EFFECT_TYPE_FIELD)
e19:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e19:SetRange(LOCATION_FZONE)
e19:SetTargetRange(LOCATION_MZONE,0)
e19:SetValue(LOCATION_HAND)
Duel.RegisterEffect(e19,1-player_ai)
local e20=Effect.GlobalEffect(c)
e20:SetType(EFFECT_TYPE_FIELD)
e20:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e20:SetRange(LOCATION_FZONE)
e20:SetTargetRange(LOCATION_HAND,0)
e20:SetValue(1)
Duel.RegisterEffect(e20,1-player_ai)
local e21=Effect.GlobalEffect(c)
e21:SetType(EFFECT_TYPE_FIELD)
e21:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e21:SetRange(LOCATION_FZONE)
e21:SetTargetRange(LOCATION_MZONE,0)
e21:SetValue(1)
Duel.RegisterEffect(e21,1-player_ai)
local e22=Effect.GlobalEffect(c)
e22:SetType(EFFECT_TYPE_FIELD)
e22:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e22:SetRange(LOCATION_FZONE)
e22:SetTargetRange(LOCATION_MZONE,0)
e22:SetValue(1)
Duel.RegisterEffect(e22,1-player_ai)
local e23=Effect.GlobalEffect()
e23:SetType(EFFECT_TYPE_FIELD)
e23:SetCode(EFFECT_REVERSE_DAMAGE)
e23:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e23:SetTargetRange(1,0)
e23:SetValue(1)
Duel.RegisterEffect(e23,1-player_ai)
local e24=Effect.GlobalEffect()
e24:SetType(EFFECT_TYPE_FIELD)
e24:SetCode(EFFECT_PIERCE)
e24:SetRange(LOCATION_FZONE)
e24:SetTargetRange(LOCATION_MZONE,0)
e24:SetValue(1)
Duel.RegisterEffect(e24,1-player_ai)
local e25=Effect.GlobalEffect()
e25:SetType(EFFECT_TYPE_FIELD)
e25:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e25:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e25:SetTargetRange(1,0)
e25:SetValue(1)
Duel.RegisterEffect(e25,1-player_ai)
local e26=Effect.GlobalEffect()
e26:SetType(EFFECT_TYPE_FIELD)
e26:SetCode(EFFECT_CHANGE_DAMAGE)
e26:SetRange(LOCATION_FZONE)
e26:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e26:SetTargetRange(1,0)
e26:SetValue(0)
Duel.RegisterEffect(e26,1-player_ai)
local e27=e26:clone()
e27:SetCode(EFFECT_NO_EFFECT_DAMAGE)
Duel.RegisterEffect(e27,1-player-ai)
local e28=Effect.GlobalEffect(c)
e28:SetType(EFFECT_TYPE_FIELD)
e28:SetCode(EFFECT_DIRECT_ATTACK)
e28:SetRange(LOCATION_FZONE)
e28:SetTargetRange(LOCATION_ONFIELD,0)
e28:SetValue(1)
Duel.RegisterEffect(e28,1-player_ai)
local e29=Effect.GlobalEffect(c)
e29:SetType(EFFECT_TYPE_FIELD)
e29:SetCode(EFFECT_CANNOT_TRIGGER)
e29:SetRange(LOCATION_FZONE)
e29:SetTargetRange(0,0xFF)
e29:SetValue(1)
Duel.RegisterEffect(e29,1-player_ai)
local e30=Effect.GlobalEffect(c)
e30:SetType(EFFECT_TYPE_FIELD)
e30:SetCode(EFFECT_CANNOT_ATTACK)
e30:SetRange(LOCATION_FZONE)
e30:SetTargetRange(0,LOCATION_MZONE)
e30:SetValue(1)
Duel.RegisterEffect(e30,1-player_ai)
end
Edited by user
2019-10-17T01:00:51Z
|
Reason: Forbid opponent from attacking.
File Attachment(s):
ai-cheatingplayer.lua (2kb) downloaded 25 time(s).
You cannot view/download attachments. Try to login or register.