![]() |
#11 |
Veteran
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,435
![]() |
Well here's a start:
Code:
/** * Execute an effect chain. * * \param effect is the effect chain * \param origin is the origin of the effect (player, monster etc.) * \param obj is the object making the effect happen (or NULL) * \param ident will be updated if the effect is identifiable * (NB: no effect ever sets *ident to false) * \param aware indicates whether the player is aware of the effect already * \param dir is the direction the effect will go in * \param beam is the base chance out of 100 that a BOLT_OR_BEAM effect will beam * \param boost is the extent to which skill surpasses difficulty, used as % boost. It * ranges from 0 to 138. */ bool effect_do(struct effect *effect, struct source origin, struct object *obj, bool *ident, bool aware, int dir, int beam, int boost) |
![]() |
![]() |
![]() |
#12 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,675
Donated: $60
![]() |
I think you'll have to write an effect handler (see effects.c - there are a whole lot of them) which will need to call py_attack_real() for each monster you want to hit. To do this you'll need to make py_attack_real() callable from other files, which means adding its definition to player-attack.h and including player-attack.h in effects.c.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#13 |
Knight
Join Date: Oct 2019
Posts: 945
![]() |
OK, thanks!
|
![]() |
![]() |
![]() |
#14 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,999
Donated: $40
![]() |
The reason things are so abstract now is that, while the code is somewhat harder to understand, it is much easier to add things. In the old days, you would need to modify:
* the parser * at least one .h file * the global spell list * the config files Now to add most spells all you need to change is a couple config (.txt) files and possibly a .h file. Your change requires new interpretation in-code, as you need to surface weapon attacks as a magic effect, so you need a new spell effect procedure. |
![]() |
![]() |
![]() |
#15 |
Knight
Join Date: Oct 2019
Posts: 945
![]() |
|
![]() |
![]() |
![]() |
#16 |
Knight
Join Date: Oct 2019
Posts: 945
![]() |
Is there a faster way to check my C syntax than to try to make the whole project?
|
![]() |
![]() |
![]() |
#17 | |
Adept
Join Date: Aug 2019
Posts: 119
![]() |
Quote:
Code:
make src/mon-attack.o src/mon-blows.o Code:
make -f Makefile.osx mon-attack.o man-blows.o |
|
![]() |
![]() |
![]() |
#18 |
Knight
Join Date: Oct 2019
Posts: 945
![]() |
Oh, OK. I tried cc and that was awful. I'll try this way, or not, since you say it won't help much anyway.
Last edited by DavidMedley; March 17, 2020 at 03:06. Reason: Was mistaken |
![]() |
![]() |
![]() |
#19 |
Knight
Join Date: Oct 2019
Posts: 945
![]() |
A bit off-topic, but when I was trying to trace incremental changes to HP and SP, I found that SP regenerates every turn, but HP regens only every fourth turn, except when resting and then the ratio is 2 to 1. I don't understand how or why this is happening. Maybe I screwed something up.
I don't want to track it down right now, but I couldn't help but wonder aloud about it. |
![]() |
![]() |
![]() |
#20 |
Knight
Join Date: Oct 2019
Posts: 945
![]() |
Can someone explain the difference between power and mult in object_properties.txt?
# power: the value given to the property in object power calculations # mult: relative value of properties, used in power calculations # type-mult: extra multiplier used in power for particular properties on # particular types of object. Assumed 1 if not mentioned |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
is there a code? | jozmon | Development | 19 | August 4, 2014 01:38 |
Questions regarding vanilla inscriptions | Avenger | Vanilla | 8 | December 13, 2013 22:15 |
Questions regarding vanilla dungeon design | Cazliostro | Vanilla | 23 | October 11, 2010 13:05 |
code help please | will_asher | Variants | 22 | March 15, 2010 20:00 |
Looking through the code | K.I.L.E.R | Vanilla | 5 | July 11, 2007 09:01 |