package flash
{
public dynamic class Main extends flash.display.MovieClip
{
public var lProxy;
var her;
var g;
//Extract out in to settings?
var swMin:Number = 4/10;
var swScaling:Number = 5/10
var stage1:Number = 30;
var stage2:Number = 16;
var stage3:Number = 16;
var stage4:Number = 30;
var startTimeRange:Number = 60;
var startTimeMin:Number = 50;
public function initl(l){
her = l.her;
g = l.g;
var lp = lProxy.createProxy(her, "swallow");
lp.addPre(sw, true);
lp.hooked = false;
lp = lProxy.createProxy(her, "swallowFromMouth");
lp.addPre(sfm, true);
lp.hooked = false;
l.unloadMod();
}
private function sw(a:Number = 2, b:Boolean = true):void{
if(her.swallowing || her.passedOut || her.speaking) return;
her.swallowSequence.intensity = swScaling * (her.cumInMouth / her.maxCumInMouth) + swMin;
her.swallowSequence.build = Math.round(stage1 * her.swallowSequence.intensity);
her.swallowSequence.swallow = Math.round(her.swallowSequence.build + stage2 * her.swallowSequence.intensity);
her.swallowSequence.relax = Math.round(her.swallowSequence.swallow + stage3 * her.swallowSequence.intensity);
her.swallowSequence.end = Math.round(her.swallowSequence.relax + stage4 * her.swallowSequence.intensity);
her.swallowTimer = 0;
her.startSwallowTime = Math.floor(Math.random() * startTimeRange + startTimeMin);
her.startSwallowTimer = 0;
g.addBreath(2);
her.breathing = g.soundControl.stopBreathing();
if(her.cumInMouth > 0 && b)
{
g.dialogueControl.buildState("swallow",120);
}
her.coughBuild = her.coughBuild + her.swallowSequence.intensity * 10;
her.swallowing = true;
}
//Since we scale animation manually, clear mouth in one go.
private function sfm() : void {
her.cumInMouth = 0;
}
}
}