cheahjs / TerrariaAPI-Server

Fork is now over at https://github.com/NyxStudios/TerrariaAPI-Server
https://tshock.co
32 stars 24 forks source link

New hooks #12

Closed CoderCow closed 11 years ago

CoderCow commented 12 years ago

Added hooks: NpcHooks.UseDoor NpcHooks.TriggerPressurePlate ProjectileHooks.TriggerPressurePlate

I need these hooks to fully integrate my Advanced Circuits plugin into Terraria Server and would be thankful if you could merge these in.

hakusaro commented 12 years ago

Sounds useful, if the code's okay. On Oct 4, 2012 9:21 AM, "CoderCow" notifications@github.com wrote:

Added hooks: NpcHooks.UseDoor NpcHooks.TriggerPressurePlate ProjectileHooks.TriggerPressurePlate

I need those hooks to fully integrate my Advanced Circuits plugin into

Terraria Server and would be thankful if you could merge these in.

You can merge this Pull Request by running:

git pull https://github.com/CoderCow/TerrariaAPI-Server master

Or view, comment on, or merge it at:

https://github.com/Deathmax/TerrariaAPI-Server/pull/12 Commit Summary

  • Added hooks:

File Changes

  • A Hooks/Classes/NpcUseDoorEventArgs.cs (29)
  • A Hooks/Classes/TriggerPressurePlateEventArgs.cs (37)
  • M Hooks/NpcHooks.cs (36)
  • M Hooks/ProjectileHooks.cs (19)
  • M Terraria/Collision.cs (24)
  • M Terraria/NPC.cs (80)
  • M Terraria/Player.cs (2)
  • M Terraria/Projectile.cs (2)
  • M TerrariaAPI-Server.csproj (335)

Patch Links

CoderCow commented 12 years ago

I also did some ingame testing and NPCs (friendly or mobs) walking over pressure plates as well as boulders that fall onto or roll over them raise the respective event.

NpcHooks.UseDoor is raised as a friendly NPC is about to open or close a door, same for mobs when they are about to open a door after they punched it several times. Though, if a mob punched a door several times but the door is unable to open because it is blocked, the event is spammed for each game frame as long as the npc stays close to that door. This should not be a big issue but I don't see a simple solution for that.

k0rd commented 12 years ago

If it becomes troublesome, we could always duplicate the first part of WorldGen.OpenDoor to check to see if the door is blocked to cut down on the event spam...

CoderCow commented 12 years ago

Yes, good idea.

hakusaro commented 12 years ago

So I guess we'll wait on that?

CoderCow commented 12 years ago

Updated and works fine.

hakusaro commented 12 years ago

Should we API version this?

Olink commented 12 years ago

Probably be wise :\

CoderCow commented 11 years ago

I'm sorry for all the delay, I guess? As the API version was already ticked in the meantime, this seems to be out of question now.