|
Author |
Topic: Programming Suite oddity |
Title: Neophyte
Posts: 2
Joined: 22 Dec 2010
|
Date Posted: Thu Dec 23, 2010 3:46 am
Subject: Programming Suite oddity
|
I only have the 2e and 4e books, so I turned to looking at the code to understand how some things work. While doing so, I ran across this in the current source (pro_create.cpp):
Quote: |
skill = MIN(GET_SKILL(ch, SKILL_COMPUTER), GET_OBJ_VAL(suite, 1));
|
Which didn't seem to make sense to me. Shouldn't the suite provide additional dice instead of imposing a limit?
And then I found this in the 0.8.20b archive:
Quote: |
skill += MIN(GET_SKILL(ch, SKILL_COMPUTER), GET_OBJ_VAL(suite, 1));
|
... which makes a bit more sense. Might've been an accident (or maybe I just don't understand the intent); either way, figure I'd bring it up.
|
Post Reply | Quote | Private Message
|
Title: Member
Posts: 274
Joined: 31 Mar 2007
|
Date Posted: Thu Dec 23, 2010 8:42 am
Subject:
|
What you're saying makes sense; setting the skill as the lesser of the two instead of adding that same value is probably a typo in the code. My code also appears to add the lesser to the skill, though it's slightly modified from Awake core.
Code: | struct obj_data *max_suite;
for (struct obj_data *suite = comp->contains; suite; suite = suite->next_content)
if (GET_OBJ_TYPE(suite) == ITEM_PROGRAM && GET_OBJ_VAL(suite, 0) == SOFT_SUITE)
if (!max_suite || GET_OBJ_VAL(suite, 1) > GET_OBJ_VAL(max_suite, 1))
max_suite = suite;
if (max_suite)
skill += MIN(GET_SKILL(ch, SKILL_COMPUTER), GET_OBJ_VAL(max_suite, 1)); |
-----signature----- :::The Star Sapphire:::
|
Post Reply | Quote | Private Message
|
Title: Site Admin
Posts: 557
Joined: 03 Apr 2005
|
Date Posted: Thu Dec 23, 2010 7:42 pm
Subject:
|
Nicely spotted. Not quite the fix that is needed though, same as you Lucien.
The success test that follows the loop to check for programming suites should also be inside that loop as it terminates straight away.
In it's old form it was actually detrimental to have a programming suite as it was using your skill for the initial programming test and also for the complementary test.
Code: |
for (struct obj_data *suite = comp->contains; suite; suite = suite->next_content)
if (GET_OBJ_TYPE(suite) == ITEM_PROGRAM && GET_OBJ_VAL(suite, 0) == SOFT_SUITE) {
success += (int)(success_test(MIN(GET_SKILL(ch, SKILL_COMPUTER), GET_OBJ_VAL(suite, 1)), target) / 2);
break;
}
|
|
Post Reply | Quote | Private Message
|
Title: Member
Posts: 274
Joined: 31 Mar 2007
|
Date Posted: Thu Dec 23, 2010 8:53 pm
Subject:
|
Ahh yes, I see what you mean. I'm still a fan of searching through the programs for the highest-rated suite before executing, though- it makes no sense to penalize a player for having a lower-level suite stored at the beginning of the list if a higher-level suite is available further in.
-----signature----- :::The Star Sapphire:::
|
Post Reply | Quote | Private Message
|
|
|
Awakened Worlds Forum Index » AwakeMUD Core Development |
|
All times are GMT
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
The time now is Sat Apr 21, 2018 4:04 am
|
powered by hailBoards v.1.2.0 ©2006 SPIRE / [based on phpBB©]
|
| |