[WIP] McCombatRealism - For a more realistic fighting experience

Discussion in 'WIP and Development Status' started by WingsIsaac, Aug 12, 2011.

Thread Status:
Not open for further replies.
  1. Offline


    McCombatRealism - For a more realistic fighting experience
    Concept and Coding by: Isaac (WingsIsaac, AKA me)
    Introduction to McCombatRealism
    'Sup, Bukkit developers community? I've been working on a plugin recently (that is to say, since this morning). However, it's basically my first ever bukkit plugin. Now, I'm very familiar with Java, and a lot of things related to Java, including minecraft modding outside of bukkit, so don't get me wrong, you're not going to be helping out a complete noob here.
    But I digress. Before going into detail about what I need help with, I think it'd be best to run through the idea, and all the plans for the first release of this plugin.
    The concept itself is pretty simple - the idea is, as you enter combat, the blows you take have a chance of being "Just a flesh would" or "A crippling blow", if you will.​
    So I've added a random chance of having some sort of affliction when you take damage, depending on the circumstances, and of course whether or not it's enabled. Basically, here's how it goes:​
    The Plugin - Functions and Features

    Armor heirarchy: (helmets affect headshots, legging protects leg crippling)
    leather - 1.2 times less likely to get impaired
    Chain - 1.5 times less likely to get impaired
    Iron - 1.75 times less likely to get impaired
    Diamond - 2 times less likely to get impaired

    Getting hit by a monster (the probabilities are completely off the wall, by the way):
    1/14 chance of getting a crippling blow to the leg, which reduces your movement speed to 75% for a specified time
    1/20 chance of getting a hard hit on the head, which will crit, if enabled, as well as make your character face a random direction, disorienting you

    Getting hit by another player, or hitting an enemy (monster or player):
    1/14 chance of crippling the enemy by hitting their leg
    1/20 chance of landing a hard shot on the head
    Logic: hands may be more accurate, because it's much easier to manipulate than a tool, but it's harder to land a stronger hit

    1/14 chance of crippling the enemy by hitting their leg
    1/10 chance of dealing a hard blow to the head
    1/5 chance to cause bleeding, which will hurt you if you move. Heals after 3 seconds
    Logic: Swords would be overpowered if I didn't balance it out like this :D

    1/10 chance of dealing a crippling blow to the leg
    1/10 chance of dealing a hard blow to the head, which will completely disorient them for 2 seconds, making their sight go crazy
    Logic: You have a head for your shovel, which is a slightly smaller area to cripple with, so it has a lower chance. Getting a headshot will make their ears ring, completely disorienting them.

    1/10 chance of dealing crippling damage to their legs
    1/10 chance of landing a hard shot on their head - extra crit damage
    Logic: Like the shovel as far as accuracy. Also, try taking an axe to the head and telling me it doesn't deserve extra crit dmg

    Armor doesn't help against pickaxes
    1/20 chance of crippling
    1/25 chance of head shotting, which gets hyper-extra-over-crit damage
    1/8 chance to puncture enemy's side, which makes it hard to breath, and they take damage when they swing their weapon.
    Logic: The point of power on the pickaxe is so small, it would be hard to hit. However, it would pierce the armor like nothing at all, and... Well, tell me a pickaxe to the head wouldn't hurt. I will hurt you.

    Not blocked by leather. Chain mail is as effective as diamond against it.
    1/15 chance of crippling legs, although it reduces their speed extra.
    1/18 chance of headshotting. Headshots with bow do extra crit damage
    Logic: As a former medieval fanatic, I learned that the design of chainmail is optimal against arrows, as the iron rings are usually smaller than arrowheads, making them unable to pierce it, as it first of all, manages to avoid the most piercing part, the tip, and absorbs the impact. Otherwise, aiming with a bow is trickier than with a sword. The rate of hitting trickier areas is lower, although it's more effective as if it were more realistic, the arrow would stay planted there, making it more realistic.

    Issues in development
    I'm going to go through this accordingly with the list of ideas -
    First, how do I detect what items are in the headgear and leggings slots?
    Next, how do I change movement speed? I've seen some setSpeed plugins that listen for player_move, and then change the velocity accordingly to their settings. Is this the best way?
    Next, when you get headshotted, I want it to change the way you're looking randomly, to disorient you.
    I've tried using player.getLocation().setYaw() and setPitch(), but it doesn't do anything. I tried aslo creating a random vector and setting their velocity... I had fun flying in random directions when I got hit, but the rotation didn't change.
    After that is bleeding with the sword. I don't want the player to lose health uber quickly when moving only a bit. Could someone tell me how much the player has to move before it sets off a playerMoveEvent?
    After that is stunning with the shovel. this one's a challenge for me. Even once I figure out how to change the rotation of the player, I'm not sure how to make it screw up your directions. Would it be possible to add a mouse movement listener, and make it so that when you move the mouse, instead of just moving the view the normal way, it'll randomize the sensitivity, making it very clumsy?
    Next would be puncturing the enemy's side with the pickaxe. I imagine there's a listener for entity_attack or something of the sort. I'm just not there yet.

    Extra info

    I made sure it's impossible to both headshot and legshot at once. Can't have your weapons in two places at once.

    Well, that's all. Looking forward to some answers!
  2. Offline


    I can't help you with any of the problem's you're having but this looks amazing! Good luck!
  3. Offline


    I'm glad you like the idea!

    Some help would be nice eventually, though, or it won't get finished
  4. Offline


    Still no help? D:
  5. Offline


    I'm really busy atm and I have just got into bukkit coding but the first thing you check out is the javadocs and resources section on bukkit. Also, go to the bukkitdev IRC and ask there. As for your armor problem you should be able to find the solution to it here: http://jd.bukkit.org/doxygen/dc/d39/interfaceorg_1_1bukkit_1_1inventory_1_1PlayerInventory.html
    and then the listeners for entities are here: http://jd.bukkit.org/doxygen/d9/da5/namespaceorg_1_1bukkit_1_1event_1_1entity.html
    notice that entitydamagebyprojectile is deprecated and now entitydamagebyentity is used.
    WingsIsaac likes this.
  6. Offline


    Thanks, this proved pretty useful. Liked!
  7. Offline


    Insert awesomebump here
  8. Offline


    Very good idea:).
  9. Offline


    Like @Drageer said .getHelmet() ect...​
    Ya I don't know of any other way wish it was smoother than it is but its hard when overriding the client =/​
    you did: player.getLocation().setPitch(float pitch) ? and got nothing? Hmmm you may need to "move" the player to the same x, y, z cords but with updated pitch / yaw but I would have to look into that more.​
    any amount sets off player move. what you should do is set a scheduler to delay the next possible damage so players don't insta-die when they budge.​
    No no mouse listener you would have to get like onPlayerMove and check pitch / yaw and tweak them.​
    I believe the entity damaged event, damage cause, entity attack but not too sure :)
    Hope at least some of that helped
  10. Offline


    You are awesome.
    Thanks :D

    I'm on a bit of a school hiatus right now, but I'll get back to it soon enough :3
  11. Offline


    Ya no problem if you need help just ask :)
Thread Status:
Not open for further replies.

Share This Page