Recently I have been playing a game called Warframe. I found a curious problem of probability for me in the game. I don't know how to calculate it, so I want to ask for help.
The problem could be simplified below:
There is a continuous action sequence when playing a match that assuming a player has to use a skill sequence $\{1,1,2\}$ which means that using 1st skill, 1st skill, and 2nd skill in order. By the way, if you use 1st skill, you would spend $a$ points of energy. Similarly, using 2nd skill will spend $b$ points of energy.
Then, a player equipped an item that there is a $p$ chance, while using any skill, makes using the next three skills will not spend any points of energy.
What I want to calculate is the expected value of used points of energy when finished the skill sequence $\{1,1,2\}$ every time.
Assuming $a=25, b=50,p=0.2$, the simulation shows the value is about $41$.