• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Medium Priority Making Better use of Indian Weapons

As far as I can tell from "LAi_character.c", the value stored in "chr_ai.poison" is a timer. The elapsed time is deducted from this, then if it's zero the poison has expired and the attribute is deleted, otherwise depending on whether the character has the "Toughness" perk, 1 or 2 HP per unit time are lost. Stacking would mean the poison lasts longer, not do more damage per unit time. So once you've hit him, there's no point in hitting him with a poisoned weapon again because by the time the first poison has expired the fight is probably over anyway. If you're attacking someone sneakily and waiting for him to drop dead then you may as well wait the full 5 minutes (assuming the number is seconds), then if he hasn't fallen over you give him another dose.
 
Oh but i never takes 5 min for poisoned character to die. Must be something less than seconds.
Maybe 0,1 sec. Would be 30 sec. Not so unlikely.

But:
So once you've hit him, there's no point in hitting him with a poisoned weapon again
No, so I'll add an exception to prevent waisting poisoned arrows on an already poisoned
enemy.
 
Thanks for checking that, @Grey Roger.

Would it be worth to add a "stacking" mechanism to that code? That may not be too difficult.
And it would add an advantage to poisoning characters multiple times.

But if at all possible, I'd prefer not having to do that myself. ;)
 
No, so I'll add an exception to prevent waisting poisoned arrows on an already poisoned
enemy.
Before you do that, please think if that would be the best solution. Alternate option would be to DO add that stacking functionality instead.
But I'm not 100% sure which of the two potential solutions would be best; for now I personally lean towards the "stacking" one.
 
I think this is the relevant code from PROGRAM\Loc_ai\LAi_character.c:
Code:
      if(CheckAttribute(chr_ai, "poison"))
       {
         chr_ai.poison = stf(chr_ai.poison) - dltTime;
         if(stf(chr_ai.poison) <= 0.0)
         {
           DeleteAttribute(chr_ai, "poison");
         }else{
           // El Rapido -->
           /*hp = hp - dltTime*2.0;
           if(IsCharacterPerkOn(chr_ai, "Toughness"))
           {
             hp = hp - dltTime*1.0;
           }
           else
           {
             hp = hp - dltTime*2.0;
           }*/
           // El Rapido <--
           //Redone by Levis for extra perk(s)
           float multip = 4.0;
           if(CheckPerkForGroup(chr_ai, "DefendPoison")) multip -= 0.5; //party wide
           if(IsCharacterPerkOn(chr_ai, "Toughness")) multip -= 1;
           hp = hp - dltTime*multip;
           //End redo
         }
       }
Not entirely sure what that 'dltTime' input variable does though.... o_O

Anyway, I can think of two solutions:

1. Have a poison "timer" variable and a poison "intensity" one
The "timer" would get extended when newly poisoned AND the intensity increased.

I think this may get relatively complex and wouldn't always be quite correct either.
Imagine hitting a character at the very moment the first poison would stop having an effect.
Now this character would get DOUBLE poisoned for the entirety of his "next" period of being poisoned.
Not quite fair....

2. Have ONLY a "timer" one
The "intensity" could then be derived from the time value itself. And the timer would be "current timer + increase" whenever a new poison action is done.
Then damage to apply at each "update" could be calculated as:
HP hit = Timer value/Balancing variable;
So immediately after being poisoned, you get the FULL, say, "300/100=3" HP hit applied.
But once the timer gets to its end, this will be "1/100=0.01" instead. So it quite literally "wears off" after a while.

You would then get "unpoisoned" not when the timer reaches zero as it does now (because it would NEVER reach zero like this!),
but instead you could check when the timer drops below 1.0 instead.

Does that make any sense?
 
If curare is meant to be a very rare item it's logical not to spend 2 arrows on the same enemy.
Even if it's possible.
"He'll die anyway."

It's also very easy for me to make that exception: Just one phrase I think.
And easy to keep track of what's going on: characters are either poisoned or not.

I think I'll go for this simple solution now. It can always be improved/developed later on.
 
Whatever makes you happy. :doff

I do like the idea of stacking poison, but we can mark that as a Feature Request for the future.
 
I have added that "already poisoned check" + another one:
if the enemy's HP is so low that an ordinary arrow will be enough to kill him no advanced arrows are used.
Changed the amount of arrows you can carry to 3 wihout a quiver (to match what enemies can be given as max).
And another check not override the max of arrows when given some from enemy shots.

I'll leave the advanced arrows for now.
 
And more importantly: What if ENABLE_AMMOMOD is OFF???
In that case, the "bladearrows" item doesn't exist and Indians don't get any weapons at all!

As a temporary fix, I'll make sure that item is initialized regardless of the Ammo Mod toggle.
But it may require something more reliable.

And how does that "getting your arrows back" thing work?
I got the impression I may have been getting them back as part of the Auto Looting.
Because I should be able to carry and use three arrows, but I could keep killing Indians for quite some time indeed before running out!
Does that sound about right to you?
 
And going even further, we used to have code like this to equip Indians with their appropriate weapons:
Code:
      sld = LAi_CreateFantomCharacter(false, 0, false, true, 0.25, "Native", "goto", "goto2");
  TakeItemFromCharacter(sld, FindCharacterItemByGroup(sld, BLADE_ITEM_TYPE));
  TakeItemFromCharacter(sld, FindCharacterItemByGroup(sld, GUN_ITEM_TYPE));
  GiveItem2Character(sld, "pistolbow");
  sld.equip.gun = "pistolbow";
       if (ENABLE_AMMOMOD) {
         TakenItems(sld, "bladearrows", 1 + rand(2));
         sld.equip.blade = "bladearrows";
       }
       LAi_SetHP(sld, 100.0, 100.0);
       LAi_group_MoveCharacter(sld, "JUNGLE_INDIANS");

       sld = LAi_CreateFantomCharacter(false, 0, false, true, 0.25, "Native", "goto", "goto2");
  TakeItemFromCharacter(sld, FindCharacterItemByGroup(sld, BLADE_ITEM_TYPE));
  TakeItemFromCharacter(sld, FindCharacterItemByGroup(sld, GUN_ITEM_TYPE));
  GiveItem2Character(sld, "tomahawk");
  sld.equip.blade = "tomahawk";
  TakenItems(sld, "pistoldart", 2);
  sld.equip.gun = "pistoldart";           
       LAi_SetHP(sld, 100.0, 100.0);
       LAi_group_MoveCharacter(sld, "JUNGLE_INDIANS");
Note that there were two variations: The ones carrying "pistolbow" and "bladearrows" and the ones carrying "tomahawk" and "pistoldart".

As per @Levis' example, I have now replaced ALL those instances with the much shorter and generic:
Code:
       sld = LAi_CreateFantomCharacterExOtAt(true, 0, true, OFFIC_TYPE_GUARD,"isIndian","","", 10, true, 1.0, "Native", "man", "goto", "goto2");
       LAi_group_MoveCharacter(sld, "JUNGLE_INDIANS");
If I understand correctly, Indians then ALWAYS get "bow and arrows" and switch to a Tomahawk once they get into close combat.

But is that what we want? Or should there be some variety in the weapons used by Indians as well?
 
case "pistolbow": isUnique = true; break; // Bow test if NOT unique

@Jack Rackham, what do you mean with that?
Must be a comment that I have forgotten to delete.

But is that what we want? Or should there be some variety in the weapons used by Indians as well?
I think we should ask @Bartolomeu about this as the Bow was his idea from the beginning.

And more importantly: What if ENABLE_AMMOMOD is OFF???
In that case, the "bladearrows" item doesn't exist and Indians don't get any weapons at all!

As a temporary fix, I'll make sure that item is initialized regardless of the Ammo Mod toggle.
Thanks.

And how does that "getting your arrows back" thing work?
There are 2 things you could mean.
1 Having fired an arrow at an enemy you have a 50% chance of getting that arrow back when looting him.
If not flaming arrows.
2 When firing an arrow the visible bladearrow in you hand is removed for a short while. Then next arrow is then
equipped if you got one. NPC:s always have.
 
I think we should ask @Bartolomeu about this as the Bow was his idea from the beginning.
I suppose for now the current solution will do then.
In the future, hopefully we can Planned Feature - Correctly Assign Weapons for Character Type | PiratesAhoy!

1 Having fired an arrow at an enemy you have a 50% chance of getting that arrow back when looting him.
If not flaming arrows.
I meant that one. But an "arrow" is a BLADE item and not a regular item, right?
So if I kill an enemy, I get their equipped blade automatically added to my own inventory.
That probably explains what I was noticing.
 
The enemies can be in the middle of the process described as 2 and be without any equipped arrow.
Also you could have fired more than one arrow on that enemy. And an indian has 1 - 3 arrows to start with so
there should be additional looting of arrows too.
 
The enemies can be in the middle of the process described as 2 and be without any equipped arrow.
Also you could have fired more than one arrow on that enemy. And an indian has 1 - 3 arrows to start with so
there should be additional looting of arrows too.
My main point was that if you're fighting Indians with arrows yourself, you don't run out of ammo very quickly.
Because you auto-loot the arrows from your enemies and they get them when they're hit too, so there are plenty arrows going back and forth. :rofl

That isn't necessarily a bad thing though; in fact, it could be a GOOD thing.
Gives a nice advantage to arrows.
 
I am considering this "Done" and ready for testing.

Though the "Quiver" probably should still be made available somewhere....
 
I am considering this "Done" and ready for testing.

Though the "Quiver" probably should still be made available somewhere....
It's avaible in the apothecary quest already. You'll find it if you find the indian treasure.

I will try to include some of the stuff to make flaming and poisoned arrows somewhere also. altough it will be better hidden :).

@Jack Rackham which items where those again?
 
@Jack Rackham which items where those again?
These ones:
Code:
  n = InitAmmoMod(n,"curare",  AMMUNITION_ITEM_TYPE, "JRH28",13,  0.00,  3,  1,  1,1,1);// JRH: for poisoned arrows
  n = InitAmmoMod(n,"tar",  AMMUNITION_ITEM_TYPE, "JRH28",14,  0.00,  3,  1,  1,1,1);// JRH: for flaming arrows
 
Somewhere there is a thread about giving the natives a bow and arrows. I met one equipped with a bow and arrows. He fired twice at point blank range and either missed or the arrows did little to no damage.
 
Back
Top