Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5632 closed defect (fixed)

Allow auras and technologies to modify resource trickle intervals

Reported by: Stan Owned by: Stan
Priority: Should Have Milestone: Alpha 24
Component: Simulation Keywords: simple
Cc: Patch: Phab:D2794

Description (last modified by Stan)

Reported by Polakrity on Phab:D2400 currently one cannot modify resource trickle intervals.

Currently, since the interval value is always read from the template, there is no way to modify it using auras or techs.

One will have to update the GetTimers() function and handle modification changes in OnValueModification

Also since the repeattime in the timer is currently the interval, it might be nice to decouple then, and/or make them both modifiable.

Change History (6)

comment:1 by Stan, 4 years ago

Description: modified (diff)

comment:2 by elexis, 4 years ago

Description: modified (diff)
Summary: Allow auras and technologies to modify resource trickle.Allow auras and technologies to modify resource trickle intervals

One can modify resource trickles:

ResourceTrickle.prototype.OnValueModification = function(msg)
{
	if (msg.component != "ResourceTrickle")
		return;

	this.ComputeRates();
};

ResourceTrickle.prototype.ComputeRates = function()
{
	this.rates = {};
	for (let resource in this.template.Rates)
		this.rates[resource] = ApplyValueModificationsToEntity("ResourceTrickle/Rates/"+resource, +this.template.Rates[resource], this.entity);
};

From simulation/data/auras/teambonuses/ptol_player_teambonus.json:

	"modifications": [
		{ "value": "ResourceTrickle/Rates/food", "add": 1.0 }
	],

But you mean intervals as noted on IRC.

comment:3 by Stan, 4 years ago

Component: Core engineSimulation
Description: modified (diff)
Keywords: simple added

comment:4 by Stan, 4 years ago

Milestone: BacklogWork In Progress
Patch: Phab:D2794

Actually do it, since I said I would.

comment:5 by Stan, 4 years ago

Resolution: fixed
Status: assignedclosed

In 23879:

Allow the interval to be changed in the templates for the Resource Trickle component.

Reviewed by: @Freagarach
Fixes #5632
Differential Revision: https://code.wildfiregames.com/D2794

comment:6 by Stan, 4 years ago

Milestone: Work In ProgressAlpha 24
Note: See TracTickets for help on using tickets.