How do I change the sword hit damage?

Having trouble compiling code? Getting an unexpected error? Player not appearing on screen? Seeking answers on how to do a particular thing? This is the forum you're looking for, to ask other NESmaker users for assistance.
vanderblade
Posts: 65
Joined: Mon Jan 07, 2019 5:20 am

How do I change the sword hit damage?

Post by vanderblade » Tue Jan 08, 2019 5:49 am

I apologize if this is a stupid question, but I want to change the hit damage of the base sword in the Adventure Module. I am using 4.1 right now.

The "fireball" is perfect and seems to adjust to enemy hit points, but the "sword" oneshots everything.

Thanks!

And this is my second day using Nesmaker -- it's so great!
User avatar
Redherring32
Posts: 450
Joined: Sat Aug 11, 2018 2:48 pm
Location: Usa

Re: How do I change the sword hit damage?

Post by Redherring32 » Tue Jan 08, 2019 6:10 am

vanderblade wrote:
Tue Jan 08, 2019 5:49 am
I apologize if this is a stupid question, but I want to change the hit damage of the base sword in the Adventure Module. I am using 4.1 right now.

The "fireball" is perfect and seems to adjust to enemy hit points, but the "sword" oneshots everything.

Thanks!

And this is my second day using Nesmaker -- it's so great!
You could try increasing the health of your enemies.
My current WIP game: Shadow: An Adventure In Monochrome, you can also find me over at the Community Discord.
vanderblade
Posts: 65
Joined: Mon Jan 07, 2019 5:20 am

Re: How do I change the sword hit damage?

Post by vanderblade » Tue Jan 08, 2019 3:40 pm

I tried that. It works for the fireball, but the sword ignores extra hit points and still oneshots everything.

Any solution?
User avatar
dale_coop
Posts: 3710
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: How do I change the sword hit damage?

Post by dale_coop » Tue Jan 08, 2019 4:59 pm

You right, the weapon kill oneshot ennemies.
To change that, it would require some modifications in the HandleSpriteWeapon.asm script (because the weapon is not an object, but a sprite drawn when the player is in attacking state).
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
vanderblade
Posts: 65
Joined: Mon Jan 07, 2019 5:20 am

Re: How do I change the sword hit damage?

Post by vanderblade » Tue Jan 08, 2019 6:22 pm

It seems the default sword is broken in 4.1 right now.

It ignores enemy hit points. It ignores "immune to player" option. It's basically a god weapon.

I'm afraid to mess with the code. Any quick fix that's easy to implement?
User avatar
jsherman
Posts: 301
Joined: Sun Apr 22, 2018 11:25 am
Location: Cleveland OH

Re: How do I change the sword hit damage?

Post by jsherman » Tue Jan 08, 2019 7:45 pm

I temporarily deactivated my melee weapon for the same reason. I want to restore my object based weapon, but haven't gotten there yet.
"Turtle Rescue" updates can be found here: viewtopic.php?f=13&t=112
For more in-depth updates, please follow GossipTurtle on Twitter! https://twitter.com/TurtleRescueNES
User avatar
dale_coop
Posts: 3710
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: How do I change the sword hit damage?

Post by dale_coop » Tue Jan 08, 2019 8:44 pm

I think it is doable but you would need to deactivate some code in the predraw script and the handleswordsprite.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
dale_coop
Posts: 3710
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: How do I change the sword hit damage?

Post by dale_coop » Wed Jan 09, 2019 10:38 am

Here's an HandleSpriteWeapon_UsingMonsterHealth.asm that I propose (based on the original HandleSpriteWeapon.asm script): http://nesmakers.com/viewtopic.php?f=3&t=1738
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
vanderblade
Posts: 65
Joined: Mon Jan 07, 2019 5:20 am

Re: How do I change the sword hit damage?

Post by vanderblade » Wed Jan 09, 2019 2:43 pm

Thanks! I'll give it a try -- and hope for the best.

Are you going to try to fix the monster lock issue and the enemy dropping items issue too by any chance? :D
User avatar
Mugi
Posts: 552
Joined: Thu Dec 27, 2018 8:30 pm

Re: How do I change the sword hit damage?

Post by Mugi » Wed Jan 09, 2019 3:06 pm

monster drops should start working if you open the file; ModuleScripts/HurtWinLoseDeath/HandleDrops.asm
and remove the first line of the file.

Code: Select all

    RTS ;; skip drops
Post Reply