Fandom

Surfpup's tConfig Mod Wiki

Prefix Class

124pages on
this wiki
Add New Page
Comment1 Share

The Prefix class is a work-in-progress re-creation of the Prefix system, designed to be programmer-friendly and easy to use.

Vanilla Prefix RewriteEdit

Assist with re-writing vanilla prefixes! The code is mostly straight-forward, so this isn't difficult, but it is a tedious process and takes some time, so I would appreciate some help. Use the method names listed below and the TerrariaOnline wiki as a reference to rewrite the prefixes. Be sure to keep them in the right order - the ID the prefixes get will depend on their location in the array. This is what we have so far:

pref.AddRange(
	new Prefix[]{
		new Prefix("Large") 
					.RequireMelee()
					.MultiplyScale(1.12f),
		new Prefix("Massive").RequireMelee().MultiplyScale(1.18f),
		new Prefix("Dangerous").RequireMelee().MultiplyScale(1.05f).MultiplyDmg(1.05f).AddCrit(2),
		new Prefix("Savage").RequireMelee().MultiplyScale(1.10f).MultiplyDmg(1.10f).MultiplyKnockback(1.10f),
		new Prefix("Sharp").RequireMelee().MultiplyDmg(1.15f),
		new Prefix("Pointy").RequireMelee().MultiplyDmg(1.10f),
		new Prefix("Tiny").RequireMelee().MultiplyScale(1f-0.18f),
		new Prefix("Terrible").RequireMelee().MultiplyScale(1f-0.13f).MultiplyDmg(1f-0.15f).MultiplyKnockback(1f-0.15f),
		new Prefix("Small").RequireMelee().MultiplyScale(1f-0.10f),
		new Prefix("Dull").RequireMelee().MultiplyDmg(1f-0.15f),
		new Prefix("Unhappy").RequireMelee().MultiplyScale(1f-0.10f).MultiplySpeed(1f+0.10f).MultiplyKnockback(1f-0.10f),
		new Prefix("Bulky").RequireMelee().MultiplyDmg(1.05f).MultiplySpeed(1.15f).MultiplyScale(1.10f).MultiplyKnockback(1.10f),
		new Prefix("Shameful").RequireMelee().MultiplyDmg(1f-0.10f).MultiplyScale(1.10f).MultiplyKnockback(1f-0.2f),
		new Prefix("Heavy").RequireMelee().MultiplySpeed(1f+0.10f).MultiplyKnockback(1.15f),
		new Prefix("Light").RequireMelee().MultiplySpeed(1f-0.15f).MultiplyKnockback(1f-0.10f),
		new Prefix("Sighted").RequireRanged().MultiplyDmg(1.10f).AddCrit(3),
		new Prefix("Rapid").RequireRanged().MultiplySpeed(1f-0.15f).MultiplyShootspeed(1.10f), //velocity
		new Prefix("Hasty").RequireRanged().MultiplySpeed(1f-0.10f).MultiplyShootspeed(1.15f),
		new Prefix("Intimidating").RequireRanged().MultiplyShootspeed(1.05f).MultiplyKnockback(1.15f),
		new Prefix("Deadly").RequireRanged().MultiplyDmg(1.1f).MultiplySpeed(1.05f).AddCrit(2).MultiplyShootspeed(1.05f).MultiplyKnockback(1.05f),
		new Prefix("Staunch").RequireRanged().MultiplyDmg(1.1f).MultiplyKnockback(1.15f),
		new Prefix("Awful").RequireRanged().MultiplyDmg(1f-0.1f).MultiplyShootspeed(1f-0.1f).MultiplyKnockback(1f-0.1f),
		new Prefix("Lethargic").RequireRanged().MultiplySpeed(1f-0.15f).MultiplyShootspeed(1f-0.1f),
		new Prefix("Awkward").RequireRanged().MultiplySpeed(1f-0.1f).MultiplyKnockback(1f-0.2f),
		new Prefix("Powerful").RequireRanged().MultiplyDmg(1.15f).MultiplySpeed(1f-0.1f).AddCrit(1), //25
		new Prefix("Mystic").RequireMagic().MultiplyDmg(1.1f).MultiplyMana(1f-0.15f),
		new Prefix("Adept").RequireMagic().MultiplyMana(1f-0.15f),
		new Prefix("Masterful").RequireMagic().MultiplyDmg(1.15f).MultiplyMana(1f-0.2f).MultiplyKnockback(1.05f),
		new Prefix("Inept").RequireMagic().MultiplyMana(1.1f),
		new Prefix("Ignorant").RequireMagic().MultiplyDmg(1f-0.1f).MultiplyMana(1.2f), //30
		new Prefix("Deranged").RequireMagic().MultiplyDmg(1f-0.1f).MultiplyKnockback(1f-0.1f),
		new Prefix("Intense").RequireMagic().MultiplyDmg(1.1f).MultiplyMana(1.15f),
		new Prefix("Taboo").RequireMagic().MultiplySpeed(1.1f).MultiplyMana(1.1f).MultiplyKnockback(1.1f),
		new Prefix("Celestial").RequireMagic().MultiplyDmg(1.1f).MultiplySpeed(1f-0.1f).MultiplyMana(1f-0.1f).MultiplyKnockback(1.1f),
		new Prefix("Furious").RequireMagic().MultiplyDmg(1.15f).MultiplyMana(1.2f).MultiplyKnockback(1.15f), //35
		new Prefix("Keen").AddCrit(3),
		new Prefix("Superior").MultiplyDmg(1.1f).AddCrit(3).MultiplyKnockback(1.1f),
		new Prefix("Forceful").MultiplyKnockback(1.15f), //38
		new Prefix("Broken").MultiplyDmg(1f-0.3f).MultiplyKnockback(1f-0.2f), //39
		new Prefix("Damaged").MultiplyDmg(1f-0.15f), //40
		new Prefix("Shoddy").MultiplyDmg(1f-0.1f).MultiplyKnockback(1f-0.15f), //41
		new Prefix("Quick").MultiplySpeed(1.1f),
		new Prefix("Deadly").MultiplyDmg(1.1f).MultiplySpeed(1.1f),
		new Prefix("Agile").MultiplySpeed(1.1f).AddCrit(3),
		new Prefix("Nimble").MultiplySpeed(1.05f), //45
		new Prefix("Murderous").MultiplyDmg(1.07f).MultiplySpeed(1.06f).AddCrit(3),
		new Prefix("Slow").MultiplySpeed(1f-0.15f),
		new Prefix("Sluggish").MultiplySpeed(1f-0.2f),
		new Prefix("Lazy").MultiplySpeed(1f-0.08f),
		new Prefix("Annoying").MultiplyDmg(1f-0.2f).MultiplySpeed(1f-0.15f),
		new Prefix("Nasty").MultiplyDmg(1.05f).MultiplySpeed(1.1f).AddCrit(2).MultiplyKnockback(1f-0.1f), //51
		new Prefix("Manic").RequireMagic().MultiplyDmg(1f-0.1f).MultiplySpeed(1.1f).MultiplyMana(1f-0.1f), // 52
		new Prefix("Hurtful").MultiplyDmg(1.1f), //53
		new Prefix("Strong").MultiplyKnockback(1.15f), //54
		new Prefix("Unpleasant").MultiplyDmg(1.05f).MultiplyKnockback(1.15f), //55
		new Prefix("Weak").MultiplyKnockback(1f-0.2f), //56
		new Prefix("Ruthless").MultiplyDmg(1.18f).MultiplyKnockback(1f-0.1f), //57
		new Prefix("Frenzying").MultiplyDmg(1f-0.15f).MultiplySpeed(1.15f), //58
		new Prefix("Godly").MultiplyDmg(1.15f).AddCrit(5).MultiplyKnockback(1.15f),
		new Prefix("Demonic").MultiplyDmg(1.15f).AddCrit(5),
		new Prefix("Zealous").AddCrit(5), //61
		new Prefix("Hard").RequireAccessory().AddPlayerDefense(1),
		new Prefix("Guarding").RequireAccessory().AddPlayerDefense(2),
		new Prefix("Armored").RequireAccessory().AddPlayerDefense(3),
		new Prefix("Warding").RequireAccessory().AddPlayerDefense(4),
		new Prefix("Arcane").RequireAccessory().AddPlayerMana(20),
		new Prefix("Precise").RequireAccessory().AddPlayerCrit(1),
		new Prefix("Lucky").RequireAccessory().AddPlayerCrit(2),
		new Prefix("Jagged").RequireAccessory().AddPlayerDmg(0.01f),
		new Prefix("Spiked").RequireAccessory().AddPlayerDmg(0.02f),
		new Prefix("Angry").RequireAccessory().AddPlayerDmg(0.03f),
		new Prefix("Menacing").RequireAccessory().AddPlayerDmg(0.04f),
		new Prefix("Brisk").RequireAccessory().AddPlayerMovespeed(0.01f),
		new Prefix("Fleeting").RequireAccessory().AddPlayerMovespeed(0.02f),
		new Prefix("Hasty").RequireAccessory().AddPlayerMovespeed(0.03f),
		new Prefix("Quick").RequireAccessory().AddPlayerMovespeed(0.04f),
		new Prefix("Wild").RequireAccessory().AddPlayerMeleespeed(0.01f),
		new Prefix("Rash").RequireAccessory().AddPlayerMeleespeed(0.02f),
		new Prefix("Intrepid").RequireAccessory().AddPlayerMeleespeed(0.03f),
		new Prefix("Violent").RequireAccessory().AddPlayerMeleespeed(0.04f),
		new Prefix("Legendary").RequireMelee().MultiplyDmg(1.15f).MultiplySpeed(1f-0.10f).AddCrit(5).MultiplyScale(1.10f).MultiplyKnockback(1.15f),
		new Prefix("Unreal").RequireRanged().MultiplyDmg(1.15f).MultiplySpeed(1f-0.10f).AddCrit(5).MultiplyShootspeed(1.1f).MultiplyKnockback(1.15f),
		new Prefix("Mythical").RequireMagic().MultiplyDmg(1.15f).MultiplySpeed(1f-0.10f).AddCrit(5).MultiplyMana(1f-0.1f).MultiplyKnockback(1.15f) //83
	});

Methods of the Prefix ClassEdit

Here are some of the methods available:

  • public Prefix(string name, bool suffix=false, IPrefix code=null)
  • public Prefix SetCode(IPrefix code)
  • public Prefix RequireMelee()
  • public Prefix RequireRanged()
  • public Prefix RequireAccessory()
  • public Prefix RequireDamage(int dmg)
  • public Prefix AddDamage(int dmg)
  • public Prefix AddPlayerDefense(int def)
  • public Prefix AddPlayerCrit(int crit)
  • public Prefix AddPlayerMana(int mana)
  • public Prefix AddPlayerDmg(float dmg)
  • public Prefix AddPlayerMovespeed(float speed)
  • public Prefix AddPlayerMeleespeed(float speed)
  • public Prefix AddRarity(int rare)
  • public Prefix AddSpeed(int speed)
  • public Prefix AddMana(int mana)
  • public Prefix AddCrit(int crit)
  • public Prefix MultiplyMana(float mana)
  • public Prefix MultiplyDmg(float dmg)
  • public Prefix MultiplyScale(float scale)
  • public Prefix MultiplySpeed(float speed)
  • public Prefix MultiplyKnockback(float kb)
  • public Prefix MultiplyShootspeed(float s)
  • public void Apply(Item item) - Applies the changes to the item
  • public bool Check(Item item) - Checks whether the item meets requirements
  • public void Apply(Player player) - Applies effects to the player

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.