Added "Heal All Dwellers" Button

Added a button to heal all dwellers.
This commit is contained in:
TheCreatorJames committed 2016-07-22 17:34:11 -05:00
1 parent 8d9544d1aa
commit 07ff20c331
2 files changed
+13

No files matched your search

+4
View File
@@ -143,6 +143,10 @@
<label>Max All Dweller Happiness</label><br />
<button type="button" class="btn btn-primary" ng-click="maxhappinessAll()">Activate</button>
</div>
<div class="col-sm-4">
<label>Heal All Dwellers</label><br />
<button type="button" class="btn btn-primary" ng-click="healAll()">Activate</button>
</div>
</div>
</form>
+9
View File
@@ -301,6 +301,15 @@ app.controller('dwellerController', function ($scope) {
$scope.save.dwellers.dwellers[i].happiness.happinessValue = 100;
};
$scope.healAll = function () {
var sum2 = Object.keys($scope.save.dwellers.dwellers).length;
for(i=0; i<sum2; i++)
{
$scope.save.dwellers.dwellers[i].health.radiationValue = 0;
$scope.save.dwellers.dwellers[i].health.healthValue = $scope.save.dwellers.dwellers[i].health.maxHealth;
}
};
$scope.maxSpecialAll = function () {
var sum2 = Object.keys($scope.save.dwellers.dwellers).length;
for(i=0; i<sum2; i++)