Jump to content
Existing user? Sign In

Sign In



Sign Up

[RUSE] Dharok's Degrading. Oaks Version


Sanity

Recommended Posts

I've used Ruse a lot and never seen anything even similar to this.

OT:

				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));

From the recoil effect lol. It has nothing to do with barrows degrading. You're making your Dharok's return damage to the attacker..


You also have so much repetetive code. You could do it as simple as this:

DegradingItem:

		public static Optional<DegradingItem> forItem(int item) {
			for(DegradingItem d : DegradingItem.values()) {
				if(d.deg == item || d.nonDeg == item) {
					return Optional.of(d);
				}
			}
			return Optional.empty();
		}

CombatFactory:

				//Handle equipped items for our target..
				for(Item item : t2.getEquipment().getItems()) {
					
					//Check if the target's item should degrade..
					Optional<DegradingItem> deg = DegradingItem.forItem(item.getId());
					if(deg.isPresent()) {
						ItemDegrading.handleItemDegrading(t2, deg.get());
					}
					
					switch(item.getId()) { //Handle other items..
					case 2550: //Handle recoil effect..

						break;
					}
				}

Wrote this quickly.

Link to comment
Share on other sites

  • 2 years later...
  • 2 years later...
  • 3 weeks later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Contact

[email protected]

astra.security

What is a RSPS?

A RSPS, also known as RuneScape private server, is an online game based on RuneScape, and controlled by independent individuals.

Popular RSPS Servers

Runewild Ikov RedemptionRSPS

Disclaimer

Runesuite is not affiliated with runescape, jagex in any way & exists solely for educational purposes.

×
×
  • Create New...