Even though we spend a lot of gametime in the wilderness, there aren't that many 'natural' dangers our mercs face. Apart from packs of angry cats. And hunger. And disease. And harsh weather. Well, apart from all that.
Jagged Alliance 1 had the danger of snakes in the water that attacked careless mercenaries in the water - potentially instakilling them. So I want that too (apart from the instadeath part). So now that is a thing:
A new JA2_Options.ini value, ALLOW_SNAKES, controls whether snakes can attack you. Whether or not snakes are present in a sector is determined in SectorNames.xml:
...
<snakechance>
Value between 0 and 100. If > 0, snakes can attack people in water. The higher the value, the more frequent this happens.
...
<SECTOR>
<SectorGrid>B15</SectorGrid>
<szUnexploredName>Swamp</szUnexploredName>
<szDetailedUnexploredName>Swamp</szDetailedUnexploredName>
<szExploredName>Swamp</szExploredName>
<szDetailedExploredName>Swamp</szDetailedExploredName>
<sWaterType>1</sWaterType>
<usNaturalDirt>500</usNaturalDirt>
<rainchance>70</rainchance>
<sandstormchance>0</sandstormchance>
<snakechance>50</snakechance>
</SECTOR>
...
Snake attacks only happen in water. Technically, it doesn't matter whether this is a swamp, the ocean or a swimming pool, any source of water will do. For immersion reasons, I only added a positive chance to water sectors though.
Snakes will attack anybody, mercs, enemy soldiers, militia or civilians. Note that the attack chance is higher if a target is in deep water or bleeding.
Snakes can be evaded/killed/defeated. The chance is:
+ 5% base chance
+ SNAKE_EVADE_BONUS for those with the survival trait (see Skills_Settings.ini)
+ 15% if soldier has a knife in inventory (+ 10% extra if knife is in a hand slot)
- 10% if in deep water, as the snake has more angles to attack from
Snakes are no 'actors'. They thus have no bodies and cannot be killed. Emptying your gun into the water is cute but useless.
Snake attacks can cause animal and swamp disease infections.
The animation (ominous water movement) was made by me. Yes, I am aware is is rather primitive. If you can do a better one, do so, otherwise shut it.
It is possible that mechanism will be expanded - technically, only lack of animation skills and sanity checks stop me from adding raving bands of squirrels, flocks of vampiric bats or graboids. If you don't know what graboids are, you are a sad, sad person.
This is fully savegame compatible.
This has been added to the trunk in r8266 & GameDir r2327. Using the new exe without the new Gamedir resources will cause 10% of Island's population to party in your living room.
[Updated on: Mon, 04 July 2016 00:11]
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
After initial play testing with this feature I've had to lower the 50 percent chance values added into SectorNames. Seems a bit excessive. Values <25 appear reasonable.
RIP Len, ambushed in the swamps by troops on either side while being bitten to death in shallow water. Gruesome.
@Gambigobilla: snakes do not 'exist' as actors. That would require bodytypes and would be a huge, HUGE can of worms to open. Instead, every turn there is simply a chance that up to 3 'snake actions' happen. This can be either a merc being attacked, or the animation just playing in a random water location. The benefit is that this is really, really easy to do. However, your idea would require storing what location we bombed in the savegame, with decay values etc.... I'd rather not.
@RunAwayScientist: Yeah, I haven't that long with it. When I had it set to 25 and tried to do the video, nobody was attacked at all, so I increased the rate. Not sure what a good value is - I don't want swamps to be a death zone, but at the same time, I want snakes to be notable.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
Would it be possible to make number of snake attacks random based on sector you're in as well?
Something like <max number of snake attacks per turn> 2d6 </> would be really cool (especially if adjustable for each sector). A swamp sector might have not only higher snake activity in general but also more snakes than a sector like Balime for example.
Don't know how or if random factors can be added to an xml... rolling different dice would be really nice, though.
Currently, <snakechance> is simply the chance that snakes will be active - this is rolled every turn. Having the number of snakes be random every turn would also work - though I think I might collect ideas here for a bit - I don't want to add tags that I then have to remove again.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
Messages:1533
Registered:January 2015 Location: Home Free
Quote:
Currently, <snakechance> is simply the chance that snakes will be active - this is rolled every turn. Having the number of snakes be random every turn would also work - though I think I might collect ideas here for a bit - I don't want to add tags that I then have to remove again.
Is it possible to have Elio kill the snakes as he did in Metavira? Maybe like a scout prevents Bloodcat ambushes?
Well, as said in the opening post, there is a chance to evade/kill/whatever the snakes and take no damage. No animations, though, as my animation skills are severly limited.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
As of r8277 & GameDir r2332, 2 new snake-related things:
A new tag, <numsnakes>, controls how many snakes are active at maximum whenever a snake attack happens (minimum is always 1, however). Valid values from 0 to 100 (though 0 doesn't make sense, and high values combined with high snake probability will make turn any water body into a Indiana Jones nightmare fuel dump).
A new background property increases snake evasion/defense:
...
<snake_defense>0</snake_defense> <!-- +- % chance to evade snake attacks, -100 to 100 -->
...
<!-- Elio -->
<BACKGROUND>
<uiIndex>196</uiIndex>
<szName>Metaviran Native</szName>
<szShortName>Metavira</szShortName>
<szDescription>The indigenous people of Metavira have adjusted to the hostile
jungle there. After the liberation, some joined the foreigners, and sought their luck elsewhere.</szDescription>
<ap_urban>-3</ap_urban>
<ap_swamp>3</ap_swamp>
<ap_tropical>3</ap_tropical>
<ap_swimming>-10</ap_swimming>
<cth_blades>7</cth_blades>
<stealth>5</stealth>
<resistance_disease>20</resistance_disease>
<camo>5</camo>
<ambush_radius>20</ambush_radius>
<snake_defense>60</snake_defense>
<no_male>1</no_male>
<no_female>1</no_female>
</BACKGROUND>
...
With a high enough value, you can become effectively immune to snake attacks. In stock, I've awarded this to Elio.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
My experience (after 2 or 3 battles in Swamp sectors) is that snake attacks happen too frequently. While they have never happened to any of my mercs (I never enter water tiles - why should I?) the enemy got attacked numerous times during every battle.