forked from Giallustio/HeartsAndMinds
-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1656 from Vdauphin/Add-Grave
Add: Reputation bonus when player put civilian killed by player in grave near religious building
- Loading branch information
Showing
15 changed files
with
149 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/createGrave.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
/* ---------------------------------------------------------------------------- | ||
Function: btc_civ_fnc_createGrave | ||
Description: | ||
Create graves and add flower bouquets next to them. | ||
Parameters: | ||
_city - City. [Object] | ||
_graves - Array of grave around city. [Array] | ||
Returns: | ||
Examples: | ||
(begin example) | ||
[btc_city_all get 1, [[getPosASL player, getDir player, "ACE_Grave"]]] call btc_civ_fnc_createGrave; | ||
(end) | ||
Author: | ||
Vdauphin | ||
---------------------------------------------------------------------------- */ | ||
|
||
params [ | ||
["_city", objNull, [objNull]], | ||
["_graves", [], [[]]] | ||
]; | ||
|
||
_city setVariable [ | ||
"btc_civ_graves", | ||
_graves apply { | ||
_x params ["_posASL", "_dir", "_graveType"]; | ||
|
||
private _grave = createVehicle [_graveType, [0, 0, 0], [], 0, "NONE"]; | ||
_grave setPosASL _posASL; | ||
_grave setDir _dir; | ||
_grave setVectorUp surfaceNormal _posASL; | ||
|
||
_flowers = []; | ||
for "_i" from 0 to (1 + round random 2) do { | ||
_flowers pushBack createSimpleObject [ | ||
selectRandom btc_type_flowers, | ||
[[_posASL vectorAdd [0, 0, 0.2], 0.2, 0.8, _dir, true]] call CBA_fnc_randPosArea | ||
]; | ||
(_flowers select _i) setDir random 360; | ||
}; | ||
|
||
[_flowers, _grave] | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
/* ---------------------------------------------------------------------------- | ||
Function: btc_rep_fnc_grave | ||
Description: | ||
Add reputation when a player put dead civil in grave. | ||
Parameters: | ||
_restingPlace - Resting Place [Object] | ||
_medic - Medic [Object] | ||
Returns: | ||
Examples: | ||
(begin example) | ||
[cursorObject, player] call btc_rep_fnc_grave; | ||
(end) | ||
Author: | ||
Vdauphin | ||
---------------------------------------------------------------------------- */ | ||
|
||
params ["_restingPlace", "_medic"]; | ||
|
||
private _church = nearestTerrainObjects [_restingPlace, ["CHURCH", "CHAPEL"], 50]; | ||
if (_church isEqualTo []) exitWith {}; | ||
_church = _church select 0; | ||
|
||
[btc_rep_bonus_grave, _medic] call btc_rep_fnc_change; | ||
|
||
private _city = [_church, values btc_city_all, false] call btc_fnc_find_closecity; | ||
private _cachingRadius = _city getVariable "cachingRadius"; | ||
|
||
if (_city distance _church < _cachingRadius) then { | ||
private _graveList = _city getVariable ["btc_rep_graves", []]; | ||
_graveList pushBack [ | ||
getPosASL _restingPlace, | ||
getDir _restingPlace, | ||
typeOf _restingPlace | ||
]; | ||
_city setVariable ["btc_rep_graves", _graveList]; | ||
|
||
private _graveList = _city getVariable ["btc_civ_graves", []]; | ||
_graveList pushBack _restingPlace; | ||
_city setVariable ["btc_civ_graves", _graveList]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters