TechSkylander1518

Player Pronouns

Nov 3rd, 2021 (edited)
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.13 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. #If you're using a version earlier than v19, change class Player to class PokeBattle_Trainer at the top
  6.  
  7. module Tech_Pronouns
  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.     @they              = "they"
  15.     @them              = "them"
  16.     @their             = "their"
  17.     @theirs            = "theirs"
  18.     @themself          = "themself"
  19.     @is                = false
  20. end
  21.  
  22.  
  23. class Player
  24.   include Tech_Pronouns
  25. end
  26.  
  27. def useIs
  28.   return $Trainer.is
  29. end
  30.  
  31.  
  32. def pronounsHim
  33.     $Trainer.they              = "he"
  34.     $Trainer.them              = "him"
  35.     $Trainer.their             = "his"
  36.     $Trainer.theirs            = "his"
  37.     $Trainer.themself          = "himself"
  38.     $Trainer.is                = true
  39. end
  40.  
  41. def pronounsHer
  42.     $Trainer.they              = "she"
  43.     $Trainer.them              = "her"
  44.     $Trainer.their             = "her"
  45.     $Trainer.theirs            = "hers"
  46.     $Trainer.themself          = "herself"
  47.     $Trainer.is                = true
  48. end
  49.  
  50. def pronounsThey
  51.     $Trainer.they              = "they"
  52.     $Trainer.them              = "them"
  53.     $Trainer.their             = "their"
  54.     $Trainer.theirs            = "theirs"
  55.     $Trainer.themself          = "themself"
  56.     $Trainer.is                = false
  57. end
  58.  
  59.  
  60. def pronounsCustom
  61.   pronoun = ""
  62.   pronoun = pbMessageFreeText(_INTL("He/She/They"),"",false,8)
  63.   $Trainer.they     = pronoun
  64.   pronoun = pbMessageFreeText(_INTL("Him/Her/Them"),"",false,8)
  65.   $Trainer.them     = pronoun
  66.   pronoun = pbMessageFreeText(_INTL("His/Her/Their"),"",false,8)
  67.   $Trainer.their    = pronoun
  68.   pronoun = pbMessageFreeText(_INTL("His/Hers/Theirs"),"",false,8)
  69.   $Trainer.theirs   = pronoun
  70.   pronoun = pbMessageFreeText(_INTL("Himself/Herself/Theirself"),"",false,8)
  71.   $Trainer.themself = pronoun
  72.   command = 0
  73.   loop do
  74.     command = pbMessage(_INTL("{1} is or {1} are?",$Trainer.they),[
  75.        _INTL("{1} is",$Trainer.they),
  76.        _INTL("{1} are",$Trainer.they)
  77.        ],-1,nil,command)
  78.     case command
  79.     when 0;
  80.       $Trainer.is = true
  81.       break
  82.     when 1;
  83.       $Trainer.is = false
  84.       break
  85.     end
  86.   end
  87. end
  88.  
  89. def pbPronouns
  90.   command = 0
  91.   loop do
  92.     command = pbMessage(_INTL("Update pronouns?"),[
  93.        _INTL("He/Him"),
  94.        _INTL("She/Her"),
  95.        _INTL("They/Them"),
  96.        _INTL("Custom"),
  97.        _INTL("Exit")
  98.        ],-1,nil,command)
  99.     case command
  100.     when 0;
  101.       pronounsHim
  102.       pbMessage(_INTL("Updated to {1} / {2}.",$Trainer.they,$Trainer.them))
  103.       break
  104.     when 1;
  105.       pronounsHer
  106.       pbMessage(_INTL("Updated to {1} / {2}.",$Trainer.they,$Trainer.them))
  107.       break
  108.     when 2;
  109.       pronounsThey
  110.       pbMessage(_INTL("Updated to {1} / {2}.",$Trainer.they,$Trainer.them))
  111.       break
  112.     when 3;
  113.       pronounsCustom
  114.       pbMessage(_INTL("Updated to {1} / {2}.",$Trainer.they,$Trainer.them))
  115.       break
  116.       else; break
  117.     end
  118.   end
  119. end
  120.  
  121.  
  122. def pbTrainerPCMenu
  123.   command = 0
  124.   loop do
  125.     command = pbMessage(_INTL("What do you want to do?"),[
  126.        _INTL("Item Storage"),
  127.        _INTL("Mailbox"),
  128.        _INTL("Pronouns"),
  129.        _INTL("Turn Off")
  130.        ],-1,nil,command)
  131.     case command
  132.     when 0; pbPCItemStorage
  133.     when 1; pbPCMailbox
  134.     when 2; pbPronouns
  135.     else; break
  136.     end
  137.   end
  138. end
  139.  
  140.    unless Kernel.respond_to?(:pbMessageDisplay_Old)
  141.       alias pbMessageDisplay_Old pbMessageDisplay
  142.       def pbMessageDisplay(*args)
  143.         if $Trainer
  144.           if $Trainer.themself
  145.             if $Trainer.is==true
  146.               args[1].gsub!(/\\hes/i,_INTL("{1}'s",$Trainer.they.downcase))
  147.               args[1].gsub!(/\\uheis/i,_INTL("{1} is",$Trainer.they.capitalize))
  148.               args[1].gsub!(/\\heis/i,_INTL("{1} is",$Trainer.they.downcase))
  149.               args[1].gsub!(/\\uhes/i,_INTL("{1}'s",$Trainer.they.capitalize))
  150.             end
  151.             if $Trainer.is==false
  152.               args[1].gsub!(/\\hes/i,_INTL("{1}'re",$Trainer.they.downcase))
  153.               args[1].gsub!(/\\heis/i,_INTL("{1} are",$Trainer.they.downcase))
  154.               args[1].gsub!(/\\uhes/i,_INTL("{1}'re",$Trainer.they.capitalize))
  155.               args[1].gsub!(/\\uheis/i,_INTL("{1} are",$Trainer.they.capitalize))
  156.             end
  157.           args[1].gsub!(/\\he/i,$Trainer.they.downcase)
  158.           args[1].gsub!(/\\uhe/i,$Trainer.they.capitalize)
  159.           args[1].gsub!(/\\him/i,$Trainer.them.downcase)
  160.           args[1].gsub!(/\\uhim/i,$Trainer.them.capitalize)
  161.           args[1].gsub!(/\\his/i,$Trainer.their.downcase)
  162.           args[1].gsub!(/\\uhis/i,$Trainer.their.capitalize)
  163.           args[1].gsub!(/\\hrs/i,$Trainer.theirs.downcase)
  164.           args[1].gsub!(/\\uhrs/i,$Trainer.theirs.capitalize)
  165.           args[1].gsub!(/\\slf/i,$Trainer.themself.downcase)
  166.           args[1].gsub!(/\\uslf/i,$Trainer.themself.capitalize)
  167.         end
  168.       end
  169.         return pbMessageDisplay_Old(*args)
  170.       end
  171. end
Add Comment
Please, Sign In to add comment