HappinessRater_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 0

HappinessRater_GoldToken:
	dw EVENT_HAPPINESS_RATER_HIDDENITEM_GOLD_TOKEN
	db GOLD_TOKEN

HappinessRaterNPC:
	faceplayer
	opentext
	special GetFirstPokemonHappiness
	writetext .rating_text
	divideop 0, 50
	anonjumptable
	dw .low_tier
	dw .D_tier
	dw .C_tier
	dw .B_tier
	dw .A_tier
	dw .S_tier

.S_tier
	writetext .S_tier_text
	checkevent EVENT_GOT_TM27
	sif false, then
		writetext .give_return_text
		givetm TM_RETURN + RECEIVED_TM
		setevent EVENT_GOT_TM27
	sendif
	closetext
	end


.A_tier
	jumptext .A_tier_text

.B_tier
	jumptext .B_tier_text

.C_tier
	jumptext .C_tier_text

.D_tier
	jumptext .D_tier_text

.low_tier
	checkevent EVENT_GOT_TM21
	sif false, then
		writetext .give_frustration_text
		givetm TM_FRUSTRATION + RECEIVED_TM
		setevent EVENT_GOT_TM21
	sendif
	closetext
	end

.rating_text
	db TX_COMPRESSED, $62, $7d, $e8, $7f, $1d, $4d, $7e, $5a
	db $4d, $e4, $e8, $81, $03, $21, $a1, $11, $7b, $66, $bf

	db $00, $75, $19, $d2, $44, $32, $15, $9c, $04, $16
	db $96, $f0, $39, $5f, $09, $31, $44, $e8, $81, $03, $21, $a1
	db $0a, $86, $49, $a4, $83, $22, $2f, $49, $7c

	db $40, $36, $e9, $23, $a8, $83, $38, $08, $2d
	db $2d, $ea, $79, $4c, $02
	db $b5, $54, $e3, $48, $b9, $b1, $f0, $be, $64, $bf
	db $2a, $e1, $e9, $ea, $0e

	db $94, $03, $17, $df, $a7

	db $80, $03, $94, $2d, $2e, $53
	db $c9, $e4, $32, $15, $9e, $63, $98, $00
	deciram hScriptVar, 1, 0
	text "/255."
	prompt

.S_tier_text
	db TX_COMPRESSED, $61, $2f, $72, $6e, $31, $47

	db $10, $05, $24, $68, $80, $e5, $7c, $24
	db $7b, $27, $80, $c8, $3b, $3e, $82, $9d, $08, $31
	db $a1, $50, $20, $b5
	db $c6, $9e, $20

.A_tier_text
	db TX_COMPRESSED, $61, $2f, $72, $6e, $32

	db $b0, $0e, $50, $b4, $b8, $0e, $57, $c2
	db $47, $ba, $35, $23, $44, $04, $16, $a6, $ce, $86, $f8
	db $d3, $40

.B_tier_text
	db TX_COMPRESSED, $61, $2f, $72, $6e, $30

	db $48, $01, $49, $1a, $20, $39, $5f, $09
	db $1e, $e8, $42, $a4, $88, $9d, $10, $20, $17
	db $a9, $a0

.C_tier_text
	db TX_COMPRESSED, $61, $2f, $72, $6e, $31
	db $b6, $9a

.D_tier_text
	db TX_COMPRESSED, $61, $2f, $72, $6e, $33

	db $80, $02, $83, $37, $d1, $01, $05, $a5, $c0, $72, $be, $12
	db $3c, $34, $12, $99, $1a, $41, $e6, $58, $60, $20
	db $b4, $a8, $11, $df
	db $a9, $a0

.give_return_text
	db TX_COMPRESSED, $61, $06, $6a, $4f, $73, $34, $99, $97, $aa
	db $46, $f5, $a4, $68, $85, $0a, $fe, $02, $0b
	db $4a, $b2, $68, $35, $83, $1c, $1d, $f1
	db $a7, $88

.give_frustration_text
	db TX_COMPRESSED, $75, $84, $04, $16, $a5, $ea, $91, $cb, $48
	db $d0, $f1, $42, $bf, $95, $0f, $bd, $80, $82, $d4, $e4
	db $ed, $50, $5a, $b8, $1c, $22, $4d, $67
	db $4b, $4f, $10

HappinessRater_MapEventHeader:: db 0, 0

.Warps
	db 2
	warp_def $5, $2, 3, OXALIS_CITY
	warp_def $5, $3, 3, OXALIS_CITY

.CoordEvents
	db 0

.BGEvents
	db 1
	signpost 4, 0, SIGNPOST_ITEM, HappinessRater_GoldToken

.ObjectEvents
	db 1
	person_event SPRITE_TEACHER, 1, 2, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 8 + PAL_OW_BLUE, PERSONTYPE_SCRIPT, 0, HappinessRaterNPC, -1

