Advertisement
TechSkylander1518

Player Pronouns (v20)

Dec 19th, 2022
1,153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.71 KB | None | 0 0
  1. #Credits:
  2. #-TechSkylander1518
  3. #-Fiona Summers (because I used her code to figure out how to make mine plug-and-play)
  4. #-Luke S.J. for the method alias help in Fiona's original code
  5. #-Astralneko for the adjective and man/woman/person additions
  6.  
  7. class Player
  8.   attr_accessor :they
  9.   attr_accessor :them
  10.   attr_accessor :their
  11.   attr_accessor :theirs
  12.   attr_accessor :themself
  13.   attr_accessor :is
  14.   attr_accessor :conjugation
  15.   attr_accessor :person
  16. end
  17.  
  18. def useIs
  19.   return $player.is
  20. end
  21.  
  22.  
  23. def pronounsHim
  24.     $player.they              = "he"
  25.     $player.them              = "him"
  26.     $player.their             = "his"
  27.     $player.theirs            = "his"
  28.     $player.themself          = "himself"
  29.     $player.is                = true
  30.     $player.conjugation       = "o"
  31. end
  32.  
  33. def pronounsHer
  34.     $player.they              = "she"
  35.     $player.them              = "her"
  36.     $player.their             = "her"
  37.     $player.theirs            = "hers"
  38.     $player.themself          = "herself"
  39.     $player.is                = true
  40.     $player.conjugation       = "a"
  41. end
  42.  
  43. def pronounsThey
  44.     $player.they              = "they"
  45.     $player.them              = "them"
  46.     $player.their             = "their"
  47.     $player.theirs            = "theirs"
  48.     $player.themself          = "themself"
  49.     $player.is                = false
  50.     $player.conjugation       = "o"
  51. end
  52.  
  53.  
  54. def pronounsIt
  55.     $player.they              = "it"
  56.     $player.them              = "it"
  57.     $player.their             = "its"
  58.     $player.theirs            = "its"
  59.     $player.themself          = "itself"
  60.     $player.is                = true
  61.     $player.conjugation       = "o"
  62. end
  63.  
  64. def pronounsCustom
  65.   pronoun = ""
  66.   pronoun = pbMessageFreeText(_INTL("He/She/They"),"",false,8)
  67.   $player.they     = pronoun
  68.   pronoun = pbMessageFreeText(_INTL("Him/Her/Them"),"",false,8)
  69.   $player.them     = pronoun
  70.   pronoun = pbMessageFreeText(_INTL("His/Her/Their"),"",false,8)
  71.   $player.their    = pronoun
  72.   pronoun = pbMessageFreeText(_INTL("His/Hers/Theirs"),"",false,8)
  73.   $player.theirs   = pronoun
  74.   pronoun = pbMessageFreeText(_INTL("Himself/Herself/Theirself"),"",false,8)
  75.   $player.themself = pronoun
  76.   $player.conjugation = "o"
  77.   #===============================##
  78.   # Spanish translation needs proper adjective (and occasionally noun) endings too
  79.   #===============================##
  80.   if $PokemonSystem.language == 1 # Spanish
  81.     pronoun = pbMessageFreeText(_INTL("¿Qué usa para terminar adjetivos, como el \"o\" en \"alto\"?"),
  82.                                   "",false,2)
  83.     $player.conjugation = pronoun
  84.   end
  85.   #===============================##
  86.   command = 0
  87.   loop do
  88.     command = pbMessage(_INTL("{1} is or {1} are?",$player.they),[
  89.        _INTL("{1} is",$player.they),
  90.        _INTL("{1} are",$player.they)
  91.        ],-1,nil,command)
  92.     case command
  93.     when 0;
  94.       $player.is = true
  95.       break
  96.     when 1;
  97.       $player.is = false
  98.       break
  99.     end
  100.   end
  101. end
  102.  
  103.  
  104. def pronounsPerson(base)
  105.   $player.person = base
  106.   command = 0
  107.   loop do
  108.     command = pbMessage(_INTL("I am a..."),[
  109.        _INTL("{1}",base),
  110.        _INTL("person"),
  111.        _INTL("(custom)"),
  112.        ],-1,nil,command)
  113.     case command
  114.     when 0;
  115.       $player.person = base
  116.       break
  117.     when 1;
  118.       $player.person = "person"
  119.       break
  120.     when 2;
  121.       $player.person = pbMessageFreeText(_INTL("I am a..."),"",false,8)
  122.       break
  123.     end
  124.   end
  125.  
  126. end
  127.  
  128.  
  129. def pbPronouns
  130.   command = 0
  131.   loop do
  132.     command = pbMessage(_INTL("Update pronouns?"),[
  133.        _INTL("He/Him"),
  134.        _INTL("She/Her"),
  135.        _INTL("They/Them"),
  136.        _INTL("It/Its"),
  137.        _INTL("Custom"),
  138.        _INTL("Exit")
  139.        ],-1,nil,command)
  140.     case command
  141.     when 0;
  142.       pronounsHim
  143.       pronounsPerson("man")
  144.       pbMessage(_INTL("Updated to {1} / {2}.",$player.they,$player.them))
  145.       break
  146.     when 1;
  147.       pronounsHer
  148.       pronounsPerson("woman")
  149.       pbMessage(_INTL("Updated to {1} / {2}.",$player.they,$player.them))
  150.       break
  151.     when 2;
  152.       pronounsThey
  153.       pronounsPerson("trainer")
  154.       pbMessage(_INTL("Updated to {1} / {2}.",$player.they,$player.them))
  155.       break
  156.     when 3;
  157.       pronounsIt
  158.       pronounsPerson("trainer")
  159.       pbMessage(_INTL("Updated to {1} / {2}.",$player.they,$player.them))
  160.       break
  161.     when 4;
  162.       pronounsCustom
  163.       pronounsPerson("trainer")
  164.       pbMessage(_INTL("Updated to {1} / {2}.",$player.they,$player.them))
  165.       break
  166.       else; break
  167.     end
  168.   end
  169. end
  170.  
  171. def pbTrainerPCMenu
  172.   command = 0
  173.   loop do
  174.     command = pbMessage(_INTL("What do you want to do?"),
  175.                         [_INTL("Item Storage"),
  176.                          _INTL("Mailbox"),
  177.                          _INTL("Pronouns"),
  178.                          _INTL("Turn Off")], -1, nil, command)
  179.     case command
  180.     when 0 then pbPCItemStorage
  181.     when 1 then pbPCMailbox
  182.     when 2 then pbPronouns
  183.     else        break
  184.     end
  185.   end
  186. end
  187.  
  188.    unless Kernel.respond_to?(:pbMessageDisplay_Old)
  189.       alias pbMessageDisplay_Old pbMessageDisplay
  190.       def pbMessageDisplay(*args)
  191.         if $player
  192.           if $player.themself
  193.             if $player.is==true
  194.               args[1].gsub!(/\\hes/i,_INTL("{1}'s",$player.they.downcase))
  195.               args[1].gsub!(/\\uheis/i,_INTL("{1} is",$player.they.capitalize))
  196.               args[1].gsub!(/\\heis/i,_INTL("{1} is",$player.they.downcase))
  197.               args[1].gsub!(/\\uhes/i,_INTL("{1}'s",$player.they.capitalize))
  198.             end
  199.             if $player.is==false
  200.               args[1].gsub!(/\\hes/i,_INTL("{1}'re",$player.they.downcase))
  201.               args[1].gsub!(/\\heis/i,_INTL("{1} are",$player.they.downcase))
  202.               args[1].gsub!(/\\uhes/i,_INTL("{1}'re",$player.they.capitalize))
  203.               args[1].gsub!(/\\uheis/i,_INTL("{1} are",$player.they.capitalize))
  204.             end
  205.           args[1].gsub!(/\\he/i,$player.they.downcase)
  206.           args[1].gsub!(/\\uhe/i,$player.they.capitalize)
  207.           args[1].gsub!(/\\him/i,$player.them.downcase)
  208.           args[1].gsub!(/\\uhim/i,$player.them.capitalize)
  209.           args[1].gsub!(/\\his/i,$player.their.downcase)
  210.           args[1].gsub!(/\\uhis/i,$player.their.capitalize)
  211.           args[1].gsub!(/\\hrs/i,$player.theirs.downcase)
  212.           args[1].gsub!(/\\uhrs/i,$player.theirs.capitalize)
  213.           args[1].gsub!(/\\slf/i,$player.themself.downcase)
  214.           args[1].gsub!(/\\uslf/i,$player.themself.capitalize)
  215.           args[1].gsub!(/\\oa/o,$player.conjugation.downcase)
  216.           args[1].gsub!(/\\man/i,$player.person.downcase)
  217.           args[1].gsub!(/\\uman/i,$player.person.capitalize)
  218.         end
  219.       end
  220.         return pbMessageDisplay_Old(*args)
  221.       end
  222. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement