Added gamerule for Single Use TMs

SingleUseTM
0 = Use TMs as many times as you like
1 = TMs can only be used once
This commit is contained in:
JappaWakka 2023-01-14 21:03:12 +01:00
parent 229b36a90b
commit e14e4c660c
3 changed files with 4 additions and 2 deletions

View File

@ -110,7 +110,7 @@
Return True
Else
If IsTM = True And Core.Player.DifficultyMode > 0 Then
If IsTM = True AndAlso CBool(GameModeManager.GetGameRuleValue("SingleUseTM", "0")) = True Then
Core.Player.Inventory.RemoveItem(ID, 1)
End If
p.Attacks.Add(BattleSystem.Attack.GetAttackByID(a.ID))

View File

@ -607,11 +607,13 @@ Public Class GameMode
gameRules.Add(New GameRule("ShowFollowPokemon", "1"))
gameRules.Add(New GameRule("OverworldPoison", "0"))
gameRules.Add(New GameRule("SavingDisabled", "0"))
gameRules.Add(New GameRule("SingleUseTM", "0"))
gameMode._gameRules = gameRules
Dim hardGameRules As New List(Of GameRule)
hardGameRules.Add(New GameRule("OverworldPoison", "1"))
hardGameRules.Add(New GameRule("SingleUseTM", "1"))
gameMode._hardGameRules = hardGameRules
Return gameMode

View File

@ -259,7 +259,7 @@
If Me.MachineItemID > -1 Then
PlayerStatistics.Track("TMs/HMs used", 1)
If Core.Player.DifficultyMode > 0 Then
If CBool(GameModeManager.GetGameRuleValue("SingleUseTM", "0")) = True Then
Dim TechMachine As Item = Item.GetItemByID(Me.MachineItemID)
If TechMachine.ItemType = Items.ItemTypes.Machines Then
If CType(TechMachine, Items.TechMachine).IsTM = True Then