File size: 4,311 Bytes
5c2ed06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
	// Archas
	lilligantiumz: {
		name: "Lilligantium Z",
		spritenum: 633,
		onTakeItem: false,
		zMove: "Aura Rain",
		zMoveFrom: "Quiver Dance",
		itemUser: ["Lilligant"],
		desc: "If held by a Lilligant with Quiver Dance, it can use Aura Rain.",
	},
	// Arya
	flygonite: {
		name: "Flygonite",
		spritenum: 111,
		itemUser: ["Flygon"],
		megaEvolves: "Flygon",
		megaStone: "Trapinch",
		onTakeItem(item, source) {
			if (item.megaEvolves === source.baseSpecies.baseSpecies) return false;
			return true;
		},
		desc: "If held by a Flygon, this item allows it to Mega Evolve in battle.",
	},
	// Irpachuza
	irpatuziniumz: {
		name: "Irpatuzinium Z",
		spritenum: 648,
		onTakeItem: false,
		zMove: "Bibbidi-Bobbidi-Rands",
		zMoveFrom: "Fleur Cannon",
		itemUser: ["Mr. Mime"],
		desc: "If held by a Mr. Mime with Fleur Cannon, it can use Bibbidi-Bobbidi-Rands.",
	},
	// Loethalion
	gardevoirite: {
		inherit: true,
		itemUser: ["Ralts"],
		megaEvolves: "Ralts",
		desc: "If held by a Ralts, this item allows it to Mega Evolve in battle.",
	},
	// Peary
	pearyumz: {
		name: "Pearyum Z",
		spritenum: 647,
		onTakeItem: false,
		zMove: "1000 Gears",
		zMoveFrom: "Gear Grind",
		itemUser: ["Klinklang"],
		desc: "If held by a Klinklang with Gear Grind, it can use 1000 Gears.",
	},
	// Rainshaft
	rainiumz: {
		name: "Rainium Z",
		spritenum: 652,
		onTakeItem: false,
		zMove: "Hatsune Miku's Lucky Orb",
		zMoveFrom: "Sparkling Aria",
		itemUser: ["Xerneas"],
		desc: "If held by a Xerneas with Sparkling Aria, it can use Hatsune Miku's Lucky Orb.",
	},

	// Modified for other effects

	eviolite: {
		inherit: true,
		onModifyDef(def, pokemon) {
			// Added Pichu-Spiky-eared for Hydrostatics to use Eviolite
			if (pokemon.baseSpecies.nfe || pokemon.species.id === 'pichuspikyeared') {
				return this.chainModify(1.5);
			}
		},
		onModifySpD(spd, pokemon) {
			// Added Pichu-Spiky-eared for Hydrostatics to use Eviolite
			if (pokemon.baseSpecies.nfe || pokemon.species.id === 'pichuspikyeared') {
				return this.chainModify(1.5);
			}
		},
	},

	// modified for nya's ability
	focusband: {
		inherit: true,
		onDamage(damage, target, source, effect) {
			const chance = target.hasAbility('adorablegrace') ? 2 : 1;
			if (this.randomChance(chance, 10) && damage >= target.hp && effect && effect.effectType === 'Move') {
				this.add("-activate", target, "item: Focus Band");
				return target.hp - 1;
			}
		},
	},
	quickclaw: {
		inherit: true,
		onFractionalPriority(priority, pokemon) {
			const chance = pokemon.hasAbility('adorablegrace') ? 2 : 1;
			if (priority <= 0 && this.randomChance(chance, 5)) {
				this.add('-activate', pokemon, 'item: Quick Claw');
				return 0.1;
			}
		},
	},

	// modified for SexyMalasada's ability
	lifeorb: {
		inherit: true,
		onAfterMoveSecondarySelf(source, target, move) {
			if (source && source !== target && move && move.category !== 'Status' && !source.forceSwitchFlag) {
				if (source.hasAbility('Ancestry Ritual')) {
					this.heal(source.baseMaxhp / 10, source, source, this.dex.items.get('lifeorb'));
				} else {
					this.damage(source.baseMaxhp / 10, source, source, this.dex.items.get('lifeorb'));
				}
			}
		},
	},

	safetygoggles: {
		inherit: true,
		onImmunity(type, pokemon) {
			if (type === 'sandstorm' || type === 'deserteddunes' || type === 'hail' || type === 'powder') return false;
		},
	},
	utilityumbrella: {
		inherit: true,
		onStart(pokemon) {
			if (!pokemon.ignoringItem()) return;
			if (['sunnyday', 'raindance', 'desolateland', 'primordialsea', 'stormsurge'].includes(this.field.effectiveWeather())) {
				this.runEvent('WeatherChange', pokemon, pokemon, this.effect);
			}
		},
		onUpdate(pokemon) {
			if (!this.effectState.inactive) return;
			this.effectState.inactive = false;
			if (['sunnyday', 'raindance', 'desolateland', 'primordialsea', 'stormsurge'].includes(this.field.effectiveWeather())) {
				this.runEvent('WeatherChange', pokemon, pokemon, this.effect);
			}
		},
		onEnd(pokemon) {
			if (['sunnyday', 'raindance', 'desolateland', 'primordialsea', 'stormsurge'].includes(this.field.effectiveWeather())) {
				this.runEvent('WeatherChange', pokemon, pokemon, this.effect);
			}
			this.effectState.inactive = true;
		},
	},
};