What should one do to make an artefact?


If you are interested in helping with tiles, vaults, patches or documentation, this is the place for that.

User avatar

Vestibule Violator

Posts: 1593

Joined: Thursday, 19th May 2011, 16:38

Location: Penza, Russia

Post Saturday, 24th March 2012, 10:07

What should one do to make an artefact?

I thought to try and implement my idea of Gauntlets of Lightning into the Stone Soup code.
Basically, they give electrocution brand to UC attacks.
An obvious solution to this is to submit a patch. But...

Which files should I consult and edit in order to make the artefact usable and make it work well?
And what should I do if I, for example, want them to cast Static Discharge on the attacked monster with chance and power depending on Evocations and Spellcasting?

Thank you in advance. =)
If you find any mistakes or typos in my post, feel free to PM me about it. Thanks in advance!

The Verse flows throughout Aquaria...
Through each ripple and wave...
Through every living being...
The Verse binds us all as one.
User avatar

Dungeon Master

Posts: 182

Joined: Saturday, 18th December 2010, 10:26

Location: Germany

Post Saturday, 24th March 2012, 15:13

Re: What should one do to make an artefact?

MyOtheHedgeFox wrote:I thought to try and implement my idea of Gauntlets of Lightning into the Stone Soup code.
Basically, they give electrocution brand to UC attacks.


Whew, that's a difficult request as so far there's no instance of armour conferring weapon brands. The closest is probably the bracers' archery brand, so searching the code for SPARM_ARCHERY could give you some ideas where to start.

Still, to give you some pointers in the right direction (all files can be found in the source sub-directory):
1. look at art-data.txt for artefact definitions in general (start out with the gloves conferring rElec or something)
2. you'll need to define a new artefact property for the elec brand: add a new property to special_armour_type in itemprop-enum.h
3. call player_equip_ego_type(ARM_GLOVES, <your new property>) in the apply_damage_brand function in melee_attack.cc under the if (weapon) check to set brand to SPWPN_ELECTROCUTION

Depending on whether the combat overhaul has already been merged into trunk, this information might not be accurate anymore. In general, it might be a good idea to put the weapon brand check on armour into a method of its own in case other such brands are added. Also, this ignores the case of auxiliary unarmed attacks both for the sake of simplicity and because I think that would make the artefact overpowered as it would in effect allow the player to use two weapon brands at the same time.

To add the discharge effect, you could either run another player_equip_ego_type check at the end of the SPWPN_ELECTROCUTION case block or at the end of the entire switch-case block where the chaos brand is checked a second time. (In both cases, make sure that the player is not wielding a weapon!) Static discharge is defined in cast_discharge in spl-damage.cc but you might have to adjust the (currently static) method _discharge_monsters instead if you want to directly target the attacked monster. Use defender->pos to get its current position. If you only want this to apply if the monster hasn't been killed yet, check for defender->alive.

You might also wish to add your new property to describe.cc and itemname.cc, though maybe that's only necessary if it's ever supposed to crop up randomly - otherwise, the artefact description (in the dat/ directory nowadays) might be enough.

Good luck!

Note that I'm not a developer anymore. The idea sounds cool but also really powerful. If it's considered overpowered, it's unlikely to make it into the game.
Please report bugs to Crawl's bug tracker, and leave feedback on the development wiki. Thank you!

For this message the author jpeg has received thanks:
MyOtheHedgeFox
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Saturday, 24th March 2012, 15:57

Re: What should one do to make an artefact?

jpeg wrote:Depending on whether the combat overhaul has already been merged into trunk, this information might not be accurate anymore.

It has been merged.

jpeg wrote:The idea sounds cool but also really powerful. If it's considered overpowered, it's unlikely to make it into the game.

I agree and I'm not sure about the balance either. No brand is supposed to be a part of UC's balance. The idea has positive comments on the wiki, but none from a dev.

@MyOtheHedgeFox: Since the implementation isn't trivial, I suggest you come to ##crawl-dev to discuss your idea. It would be a shame to spend a lot of time coding it for nothing.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

For this message the author galehar has received thanks:
MyOtheHedgeFox
User avatar

Vestibule Violator

Posts: 1593

Joined: Thursday, 19th May 2011, 16:38

Location: Penza, Russia

Post Saturday, 24th March 2012, 17:12

Re: What should one do to make an artefact?

Well I thought about settling on simply auto-evoking untargeted Static Discharge on a melee hit (1 out of [27 - Evoc/2] times) with power depending on Evocations/UC. If you have a metallic weapon in your hand (a sword or a dagger except artefacts, almost all maces and flails except whips, clubs and rods; weapons of electrocution block it completely), you get a (1 out of [27 - Evoc/4]) chance and take (3-10) units of damage.
With built-in rElec, it should still be good without being overtly bizarre. And useful against vampires and ynoxinul demons.
Would also explain why Nikola threw them away... :D

What do you think about that?


Thanks, Galehar: will do that when I have time!
If you find any mistakes or typos in my post, feel free to PM me about it. Thanks in advance!

The Verse flows throughout Aquaria...
Through each ripple and wave...
Through every living being...
The Verse binds us all as one.

Return to Contributions

Who is online

Users browsing this forum: No registered users and 7 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.